NGSolve  4.9
Public Types | Public Member Functions | Protected Attributes
ngbla::FlatVector< T > Class Template Reference

A simple vector. More...

#include <vector.hpp>

Inheritance diagram for ngbla::FlatVector< T >:
ngbla::CMCPMatExpr< FlatVector< T > > ngbla::MatExpr< FlatVector< T > > ngbla::Expr< FlatVector< T > > ngbla::Vector< T > ngbla::VectorMem< S, T >

List of all members.

Public Types

enum  { HEIGHT = 1 }
enum  { WIDTH = 1 }
typedef T TELEM
 element type
typedef T & TREF
typedef mat_traits< T >::TSCAL TSCAL
 scalar of element type
typedef FlatVector< T > TV_COL
typedef double TV_ROW

Public Member Functions

 FlatVector ()
 default constructor does nothing
 FlatVector (unsigned int as, T *adata)
 set size and mem
 FlatVector (unsigned int as, void *adata)
 set size and mem
template<int S>
 FlatVector (const Vec< S, TSCAL > &v)
 put FlatVector over fixed size vector
template<int S>
 FlatVector (const FlatVec< S, TSCAL > &v)
 FlatVector (int as, LocalHeap &lh)
 allocate FlatVector on local heap
 FlatVector (const SysVector< TSCAL > &sv)
 put FlatVector over systemvector
void AssignMemory (int as, LocalHeap &lh)
 assign memory for vector on local heap
void AssignMemory (int as, T *mem)
 assign memory for vector
const FlatVectoroperator= (const FlatVector &v) const
 copy vector. sizes must match
template<typename TB >
const FlatVectoroperator= (const Expr< TB > &v) const
 evaluate matrix expression
const FlatVectoroperator= (TSCAL scal) const
 assign constant value
template<typename TB >
const FlatVectoroperator+= (const Expr< TB > &v) const
TELEMoperator() (int i) const
 constant element access
RowsArrayExpr< FlatVectoroperator() (FlatArray< int > rows) const
TELEMoperator() (int i, int j) const
 element access. index j is ignored
TELEMoperator[] (int i) const
 constant element access
const CArray< T > Addr (int i) const
const FlatVector< T > Range (int first, int next) const
 sub-vector of size next-first, starting at first
const FlatVector< T > Range (IntRange range) const
 sub-vector given by range
int Size () const
 vector size
int Height () const
 vector is matrix of height size
int Width () const
 vector is matrix of with 1
SliceVector< T > Slice (int first, int dist)
 take a slice of the vector. Take elements first+i * dist.
const SliceVector< T > Slice (int first, int dist) const
 take a slice of the vector. Take elements first+i * dist.
const void * Data () const
 access to data
void * Data ()
 access to data

Protected Attributes

int s
 vector size
T * data
 the data

Detailed Description

template<typename T = double>
class ngbla::FlatVector< T >

A simple vector.

Has size and generic data-pointer. No memory allocation/deallocation. User must provide memory.


The documentation for this class was generated from the following file: