Tensor7 Class Reference

The Tensor7 class. More...

#include <matpackVII.h>

Inheritance diagram for Tensor7:

Inheritance graph
[legend]
Collaboration diagram for Tensor7:

Collaboration graph
[legend]

List of all members.

Public Member Functions

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


Detailed Description

The Tensor7 class.

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

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

Definition at line 1912 of file matpackVII.h.


Constructor & Destructor Documentation

Tensor7::Tensor7 (  ) 

Default constructor.

Definition at line 5211 of file matpackVII.cc.

Tensor7::Tensor7 ( Index  l,
Index  v,
Index  s,
Index  b,
Index  p,
Index  r,
Index  c 
)

Constructor setting size.

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

Definition at line 5222 of file matpackVII.cc.

Tensor7::Tensor7 ( Index  l,
Index  v,
Index  s,
Index  b,
Index  p,
Index  r,
Index  c,
Numeric  fill 
)

Constructor setting size and filling with constant value.

Definition at line 5238 of file matpackVII.cc.

References ConstTensor7View::mdata.

Tensor7::Tensor7 ( const ConstTensor7View m  ) 

Copy constructor from Tensor7View.

This automatically sets the size and copies the data.

Definition at line 5259 of file matpackVII.cc.

References Tensor7View::begin(), ConstTensor7View::begin(), copy(), and ConstTensor7View::end().

Tensor7::Tensor7 ( const Tensor7 m  ) 

Copy constructor from Tensor7.

This automatically sets the size and copies the data.

Definition at line 5275 of file matpackVII.cc.

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

Tensor7::~Tensor7 (  )  [virtual]

Destructor for Tensor7.

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

Definition at line 5396 of file matpackVII.cc.

References ConstTensor7View::mdata.


Member Function Documentation

Tensor7 & Tensor7::operator= ( const Tensor7 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 Tensor7View.

Definition at line 5318 of file matpackVII.cc.

References Tensor7View::begin(), copy(), Tensor7View::end(), ConstTensor7View::mbr, ConstTensor7View::mcr, Range::mextent, ConstTensor7View::mlr, ConstTensor7View::mpr, ConstTensor7View::mrr, ConstTensor7View::msr, ConstTensor7View::mvr, and resize().

Tensor7 & Tensor7::operator= ( Numeric  x  ) 

Assignment operator from scalar.

Assignment operators are not inherited.

Reimplemented from Tensor7View.

Definition at line 5332 of file matpackVII.cc.

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

void Tensor7::resize ( Index  l,
Index  v,
Index  s,
Index  b,
Index  p,
Index  r,
Index  c 
)

Resize function.

If the size is already correct this function does nothing. All data is lost after resizing! The new tensor is not initialized, so it will contain random values.

Definition at line 5341 of file matpackVII.cc.

References ConstTensor7View::mbr, ConstTensor7View::mcr, ConstTensor7View::mdata, Range::mextent, ConstTensor7View::mlr, ConstTensor7View::mpr, ConstTensor7View::mrr, ConstTensor7View::msr, Range::mstart, Range::mstride, and ConstTensor7View::mvr.

Referenced by CloudboxGetIncoming(), CloudboxGetIncoming1DAtm(), DoitCloudboxFieldPut(), fill_tensor7(), operator=(), Tensor7Scale(), Tensor7SetConstant(), and xml_read_from_stream().


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