|
Schnek
|
#include <array.hpp>


Public Types | |
| enum | { Length = length } |
| typedef T | value_type |
Public Member Functions | |
| Array () | |
| The default constructor. | |
| template<template< int > class CheckingPolicy2> | |
| Array (const Array< T, length, CheckingPolicy2 > &) | |
| Copy constructor copies the values. | |
| template<class Operator > | |
| Array (const ArrayExpression< Operator, length > &) | |
| Construct using an array expression. | |
| Array (const T &) | |
| Constructor for length=1 arrays setting the data explicitely. | |
| Array (const T &, const T &) | |
| Constructor for length=2 arrays setting the data explicitely. | |
| Array (const T &, const T &, const T &) | |
| Constructor for length=3 arrays setting the data explicitely. | |
| Array (const T &, const T &, const T &, const T &) | |
| Constructor for length=4 arrays setting the data explicitely. | |
| Array (const T &, const T &, const T &, const T &, const T &) | |
| Constructor for length=5 arrays setting the data explicitely. | |
| Array (const T &, const T &, const T &, const T &, const T &, const T &) | |
| Constructor for length=6 arrays setting the data explicitely. | |
| Array (const T &, const T &, const T &, const T &, const T &, const T &, const T &) | |
| Constructor for length=7 arrays setting the data explicitely. | |
| Array (const T &, const T &, const T &, const T &, const T &, const T &, const T &, const T &) | |
| Constructor for length=8 arrays setting the data explicitely. | |
| Array (const T &, const T &, const T &, const T &, const T &, const T &, const T &, const T &, const T &) | |
| Constructor for length=9 arrays setting the data explicitely. | |
| Array (const T &, const T &, const T &, const T &, const T &, const T &, const T &, const T &, const T &, const T &) | |
| Constructor for length=10 arrays setting the data explicitely. | |
| T & | operator[] (int) |
| Accessor operator. | |
| T | operator[] (int) const |
| Constant accessor operator. | |
| T & | at (int) |
| Accessor operator. | |
| T | at (int) const |
| Constant accessor operator. | |
| template<class T2 , template< int > class CheckingPolicy2> | |
| Array< T, length, CheckingPolicy > & | operator= (const Array< T2, length, CheckingPolicy2 > &) |
| template<class Operator > | |
| Array< T, length, CheckingPolicy > & | operator= (const ArrayExpression< Operator, length > &) |
| Assignment operator using an array expression. | |
| template<class T2 , template< int > class CheckingPolicy2> | |
| Array< T, length, CheckingPolicy > & | operator+= (const Array< T2, length, CheckingPolicy2 > &) |
| template<class T2 , template< int > class CheckingPolicy2> | |
| Array< T, length, CheckingPolicy > & | operator*= (const Array< T2, length, CheckingPolicy2 > &) |
| template<class T2 , template< int > class CheckingPolicy2> | |
| Array< T, length, CheckingPolicy > & | operator/= (const Array< T2, length, CheckingPolicy2 > &) |
| template<class T2 , template< int > class CheckingPolicy2> | |
| Array< T, length, CheckingPolicy > & | operator-= (const Array< T2, length, CheckingPolicy2 > &) |
| template<typename T2 > | |
| Array< T, length, CheckingPolicy > & | operator+= (const T2) |
| template<typename T2 > | |
| Array< T, length, CheckingPolicy > & | operator-= (const T2) |
| template<typename T2 > | |
| Array< T, length, CheckingPolicy > & | operator*= (const T2) |
| template<typename T2 > | |
| Array< T, length, CheckingPolicy > & | operator/= (const T2) |
| template<class Operator > | |
| Array< T, length, CheckingPolicy > & | operator+= (const ArrayExpression< Operator, length > &) |
| Addition Assignment operator using an array expression. | |
| template<class Operator > | |
| Array< T, length, CheckingPolicy > & | operator-= (const ArrayExpression< Operator, length > &) |
| Subtraction Assignment operator using an array expression. | |
| template<class Operator > | |
| Array< T, length, CheckingPolicy > & | operator*= (const ArrayExpression< Operator, length > &) |
| Element-wise multiplication assignment operator using an array expression. | |
| template<class Operator > | |
| Array< T, length, CheckingPolicy > & | operator/= (const ArrayExpression< Operator, length > &) |
| Element-wise multiplication assignment operator using an array expression. | |
| Array< T, length, CheckingPolicy > & | clear () |
| Sets all fields to zero. | |
| Array< T, length, CheckingPolicy > & | fill (const T &) |
| Fills all fields with a given value. | |
| template<int destLength> | |
| Array< T, destLength, CheckingPolicy > | project () const |
| projects the Array onto an Array of shorter length | |
| Array< T, length-1, CheckingPolicy > | projectDim (int dim) const |
| T | product () const |
| Returns the product of all elements. | |
| T | sum () const |
| Returns the sum of all elements. | |
| T | sqr () const |
| Returns the sum of squares of all elements. | |
Static Public Member Functions | |
| static Array< T, length, CheckingPolicy > | Zero () |
| static Array< T, length, CheckingPolicy > | Ones () |
A Fixed size array. The three template parameters are:
T: the type of data stored
length: the length of the array
CheckingPolicy: A policy class defining how to check the index passed to the accessor method
|
static |
Returns an array filled with ones. Only available if int can be cast to the type T
| Array<T,length,CheckingPolicy>& schnek::Array< T, length, CheckingPolicy >::operator*= | ( | const Array< T2, length, CheckingPolicy2 > & | ) |
Element-wise multiplication assignment operator
The argument can have a different value_type and checking policy. The value_type of the RHS must be implicitly castable to the value_type of the LHS.
| Array<T,length,CheckingPolicy>& schnek::Array< T, length, CheckingPolicy >::operator*= | ( | const T2 | ) |
Multiplication Assignment operator with scalar RHS.
The argument can have a different type. The type of the RHS must be implicitly castable to the value_type of the LHS.
| Array<T,length,CheckingPolicy>& schnek::Array< T, length, CheckingPolicy >::operator+= | ( | const Array< T2, length, CheckingPolicy2 > & | ) |
Addition Assignment operator
The argument can have a different value_type and checking policy. The value_type of the RHS must be implicitly castable to the value_type of the LHS.
| Array<T,length,CheckingPolicy>& schnek::Array< T, length, CheckingPolicy >::operator+= | ( | const T2 | ) |
Addition Assignment operator with scalar RHS.
The argument can have a different type. The type of the RHS must be implicitly castable to the value_type of the LHS.
| Array<T,length,CheckingPolicy>& schnek::Array< T, length, CheckingPolicy >::operator-= | ( | const Array< T2, length, CheckingPolicy2 > & | ) |
Subtraction Assignment operator
The argument can have a different value_type and checking policy. The value_type of the RHS must be implicitly castable to the value_type of the LHS.
| Array<T,length,CheckingPolicy>& schnek::Array< T, length, CheckingPolicy >::operator-= | ( | const T2 | ) |
Subtraction Assignment operator with scalar RHS.
The argument can have a different type. The type of the RHS must be implicitly castable to the value_type of the LHS.
| Array<T,length,CheckingPolicy>& schnek::Array< T, length, CheckingPolicy >::operator/= | ( | const Array< T2, length, CheckingPolicy2 > & | ) |
Element-wise division assignment operator
The argument can have a different value_type and checking policy. The value_type of the RHS must be implicitly castable to the value_type of the LHS.
| Array<T,length,CheckingPolicy>& schnek::Array< T, length, CheckingPolicy >::operator/= | ( | const T2 | ) |
Division Assignment operator with scalar RHS.
The argument can have a different type. The type of the RHS must be implicitly castable to the value_type of the LHS.
| Array<T,length,CheckingPolicy>& schnek::Array< T, length, CheckingPolicy >::operator= | ( | const Array< T2, length, CheckingPolicy2 > & | ) |
Assignment operator
The argument can have a different value_type and checking policy. The value_type of the RHS must be implicitly castable to the value_type of the LHS.
|
static |
Returns an array filled with zeros. Only available if int can be cast to the type T