Class to store reconstructed data. More...

#include <openma/maths/array.h>

using

Values = typename Traits< Array< Cols >>::Values

using

Residuals = typename Traits< Array< Cols >>::Residuals

using

Index = typename Traits< Array< Cols >>::Index

Array()

Array(Index rows)

Array(const Values &values)

Array(const Values &values, const Residuals &residuals)

Array(const XprBase< U > &other)

Array< Cols > &

operator=(const XprBase< U > &other)

using

Position = Vector

using

Scalar = Array< 1 >

using

Vector = Array< 3 >

Map< Array< N > >

to_array(TimeSequence *ts, int offset=0, int type=-1)

Map< const Array< N > >

to_array(const TimeSequence *ts, int offset=0, int type=-1)

Result

to_arraybase_derived(T *ts, int components, int offset=0, int type=-1)

Map< Position >

to_position(TimeSequence *ts)

Map< const Position >

to_position(const TimeSequence *ts)

Map< Scalar >

to_scalar(TimeSequence *ts, int offset=0, int type=-1)

Map< const Scalar >

to_scalar(const TimeSequence *ts, int offset=0, int type=-1)

Map< Vector >

to_vector(TimeSequence *ts, int offset=0, int type=-1)

Map< const Vector >

to_vector(const TimeSequence *ts, int offset=0, int type=-1)

This class is usefull for any reconstructed data that can be stored as an array with any number of columns. The values can be access by the method values() and the reconstruction residuals with the method residuals(). In general, this is not necessary to pass by these methods but directly use the operators and methods to do computations. Indeed, internally, this class use template expression to manage invalid data (negative residuals). There is no need to loop through samples to check if it is valid or not.

Add example related to the automatic management of the residuals.

ma::maths::Array::Index

ma::maths::Array::Residuals

ma::maths::Array::Values

ma::maths::Array::Array (
)
[inline]

Default constructor. Create an empty array (method isValue() returns false).

Create an array with a fixed number of *Cols* columns and a dynamic number of *rows*.

Create an array based on the given *values*. All the samples are set to valid (residuals set to 0).

Note

The number of colums for the *values* must be the same than the number of *Cols*.

Create a constructor based on the given *values* and **residuals**.

Note

The number of row for the *values* and teh *residuals* must be the same.

Constructor from an XprBase object (generaly used to store the result of a computation).

```
// a and b are other Array object.
auto c = a + b; // The assignment of c is realized with this constructor.
```

Assignment operator from an XprBase object.

Define an Array with three columns. This could represent a 3D trajectory along a sequence.

Define an Array with one column. This could represent a scalar value along a sequence.

Define an Array with three columns. This could represent a 3D vector along a sequence.

Map
<
Array
< N > >
ma::maths::Array::to_array (
TimeSequence
*
ts
, int
offset
= 0
, int
type
= -1
)
[inline]

Extract from a TimeSequence *ts* a Map*offset* to shift the data to extract. The use of *type* will verify if the TimeSequence has the requeted type.

Map
< const
Array
< N > >
ma::maths::Array::to_array (
const
TimeSequence
*
ts
, int
offset
= 0
, int
type
= -1
)
[inline]

*ts* a Map*offset* to shift the data to extract. The use of *type* will verify if the TimeSequence has the requeted type.

Result
ma::maths::Array::to_arraybase_derived (
T *
ts
, int
components
, int
offset
= 0
, int
type
= -1
)
[inline]

Extract a Result Map*ts*. The Result object will have *componments* columns. If necessary the position of the data to extract can be shifted. It is also possible to specify the type of the TimeSequence by specifying a TimeSequence::Type value to *type*. If no type is required, you can let the value to -1. In case the number of components or the shift is greater than the number of columns, a empty object will be returned, This is the same if the expected type is not the good one.

Specialized extraction method where the resulting Map

Map
<
Scalar
>
ma::maths::Array::to_scalar (
TimeSequence
*
ts
, int
offset
= 0
, int
type
= -1
)
[inline]

Specialized extraction method where the resulting Map*offset* to shift the data to extract. The use of *type* will verify if the TimeSequence has the requeted type.

Map
< const
Scalar
>
ma::maths::Array::to_scalar (
const
TimeSequence
*
ts
, int
offset
= 0
, int
type
= -1
)
[inline]

*offset* to shift the data to extract. The use of *type* will verify if the TimeSequence has the requeted type.

Map
<
Vector
>
ma::maths::Array::to_vector (
TimeSequence
*
ts
, int
offset
= 0
, int
type
= -1
)
[inline]

Specialized extraction method where the resulting Map*offset* to shift the data to extract. The use of *type* will verify if the TimeSequence has the requeted type.

Map
< const
Vector
>
ma::maths::Array::to_vector (
const
TimeSequence
*
ts
, int
offset
= 0
, int
type
= -1
)
[inline]

*offset* to shift the data to extract. The use of *type* will verify if the TimeSequence has the requeted type.