Tensor4 Class Reference

The Tensor4 class. More...

#include <matpackIV.h>

Inheritance diagram for Tensor4:

Inheritance graph
[legend]
Collaboration diagram for Tensor4:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 Tensor4 ()
 Default constructor.
 Tensor4 (Index b, Index p, Index r, Index c)
 Constructor setting size.
 Tensor4 (Index b, Index p, Index r, Index c, Numeric fill)
 Constructor setting size and filling with constant value.
 Tensor4 (const ConstTensor4View &v)
 Copy constructor from Tensor4View.
 Tensor4 (const Tensor4 &v)
 Copy constructor from Tensor4.
Tensor4operator= (const Tensor4 &x)
 Assignment operator from another tensor.
Tensor4operator= (Numeric x)
 Assignment operator from scalar.
void resize (Index b, Index p, Index r, Index c)
 Resize function.
virtual ~Tensor4 ()
 Destructor for Tensor4.


Detailed Description

The Tensor4 class.

This is a Tensor4View that also allocates storage automatically, and deallocates it when it is destroyed. We take all the functionality from Tensor4View. Additionally defined here are:

1. Constructors and destructor. 2. Assignment operators. 3. Resize function.

Definition at line 375 of file matpackIV.h.


Constructor & Destructor Documentation

Tensor4::Tensor4 (  ) 

Default constructor.

Definition at line 1294 of file matpackIV.cc.

Tensor4::Tensor4 ( Index  b,
Index  p,
Index  r,
Index  c 
)

Constructor setting size.

This constructor has to set the strides in the book, page and row ranges correctly!

Definition at line 1305 of file matpackIV.cc.

Tensor4::Tensor4 ( Index  b,
Index  p,
Index  r,
Index  c,
Numeric  fill 
)

Constructor setting size and filling with constant value.

Definition at line 1316 of file matpackIV.cc.

References ConstTensor4View::mdata.

Tensor4::Tensor4 ( const ConstTensor4View m  ) 

Copy constructor from Tensor4View.

This automatically sets the size and copies the data.

Definition at line 1332 of file matpackIV.cc.

References Tensor4View::begin(), ConstTensor4View::begin(), copy(), and ConstTensor4View::end().

Tensor4::Tensor4 ( const Tensor4 m  ) 

Copy constructor from Tensor4.

This automatically sets the size and copies the data.

Definition at line 1344 of file matpackIV.cc.

References Tensor4View::begin(), copy(), and Tensor4View::end().

Tensor4::~Tensor4 (  )  [virtual]

Destructor for Tensor4.

This is important, since Tensor4 uses new to allocate storage.

Definition at line 1439 of file matpackIV.cc.

References ConstTensor4View::mdata.


Member Function Documentation

Tensor4 & Tensor4::operator= ( const Tensor4 m  ) 

Assignment operator from another tensor.

While dimensions of views can not be adjusted, dimensions of tensors *can* be adjusted. Hence, the behavior of the assignment operator is different.

In this case the size of the target is automatically adjusted. This is important, so that structures containing tensors are copied correctly.

This is a deviation from the old ARTS paradigm that sizes must match exactly before copying!

Note: It is sufficient to have only this one version of the assignment (Tensor = Tensor). It implicitly covers the cases Tensor=TensorView, etc, because there is a default constructor for Tensor from TensorView. (See C++ Primer Plus, page 571ff.)

Parameters:
m The other tensor to assign to this one.
Returns:
This tensor, by tradition.
Author:
Stefan Buehler
Date:
2002-12-19

Reimplemented from Tensor4View.

Definition at line 1383 of file matpackIV.cc.

References Tensor4View::begin(), copy(), Tensor4View::end(), ConstTensor4View::mbr, ConstTensor4View::mcr, Range::mextent, ConstTensor4View::mpr, ConstTensor4View::mrr, and resize().

Tensor4 & Tensor4::operator= ( Numeric  x  ) 

Assignment operator from scalar.

Assignment operators are not inherited.

Reimplemented from Tensor4View.

Definition at line 1395 of file matpackIV.cc.

References Tensor4View::begin(), copy(), and Tensor4View::end().

void Tensor4::resize ( Index  b,
Index  p,
Index  r,
Index  c 
)


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

Generated on Mon Mar 23 14:07:04 2009 for ARTS by  doxygen 1.5.6