Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Array_n Class Reference

#include <Vector_n.h>

Inheritance diagram for Array_n:

Public Types

typedef Array_n Self
 
typedef Real Value
 
typedef RealPointer
 
typedef Real const * Const_pointer
 
typedef RealReference
 
typedef const RealConst_reference
 
typedef unsigned int Size
 

Public Member Functions

 Array_n ()
 
 Array_n (Real *v, Size n)
 
 Array_n (Real *v1, Real *v2)
 
 Array_n (const Self &v)
 
 operator const Array_n_const & () const
 
Reference operator[] (Size i)
 
Const_reference operator[] (Size i) const
 
Size dimension () const
 
Const_pointer begin () const
 
Const_pointer end () const
 
Pointer begin ()
 
Pointer end ()
 
Real squared_norm () const
 
Selfoperator= (const Array_n_const &v)
 
Selfoperator= (const Self &v)
 
Selfoperator= (const Vector_n &v)
 
Selfoperator+= (const Array_n_const &v1)
 
Selfoperator-= (const Array_n_const &v1)
 
Selfoperator*= (Real t)
 
Selfoperator*= (const Array_n_const &v1)
 
Selfoperator/= (Real t)
 
Selfoperator/= (const Array_n_const &v1)
 
Selfinvert ()
 

Protected Attributes

Real_start
 
Real_end
 

Friends

class Vector_n
 

Detailed Description

Definition at line 96 of file Vector_n.h.

Member Typedef Documentation

typedef Real const* Const_pointer

Definition at line 101 of file Vector_n.h.

typedef const Real& Const_reference

Definition at line 103 of file Vector_n.h.

typedef Real* Pointer

Definition at line 100 of file Vector_n.h.

typedef Real& Reference

Definition at line 102 of file Vector_n.h.

typedef Array_n Self

Definition at line 98 of file Vector_n.h.

typedef unsigned int Size

Definition at line 104 of file Vector_n.h.

typedef Real Value

Definition at line 99 of file Vector_n.h.

Constructor & Destructor Documentation

Array_n ( )
inline

Definition at line 108 of file Vector_n.h.

108 : _start(0), _end(0) {}
Real * _end
Definition: Vector_n.h:181
Real * _start
Definition: Vector_n.h:181
Array_n ( Real v,
Size  n 
)
inline

Definition at line 109 of file Vector_n.h.

109 : _start(v), _end(v+n) {}
Real * _end
Definition: Vector_n.h:181
*********************************************************************Illinois Open Source License ****University of Illinois NCSA **Open Source License University of Illinois All rights reserved ****Developed free of to any person **obtaining a copy of this software and associated documentation to deal with the Software without including without limitation the rights to and or **sell copies of the and to permit persons to whom the **Software is furnished to do subject to the following this list of conditions and the following disclaimers ****Redistributions in binary form must reproduce the above **copyright this list of conditions and the following **disclaimers in the documentation and or other materials **provided with the distribution ****Neither the names of the Center for Simulation of Advanced the University of nor the names of its **contributors may be used to endorse or promote products derived **from this Software without specific prior written permission ****THE SOFTWARE IS PROVIDED AS WITHOUT WARRANTY OF ANY **EXPRESS OR INCLUDING BUT NOT LIMITED TO THE WARRANTIES **OF FITNESS FOR A PARTICULAR PURPOSE AND **NONINFRINGEMENT IN NO EVENT SHALL THE CONTRIBUTORS OR **COPYRIGHT HOLDERS BE LIABLE FOR ANY DAMAGES OR OTHER WHETHER IN AN ACTION OF TORT OR **ARISING OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE **USE OR OTHER DEALINGS WITH THE SOFTWARE v
Definition: roccomf90.h:20
const NT & n
Real * _start
Definition: Vector_n.h:181
Array_n ( Real v1,
Real v2 
)
inline

Definition at line 110 of file Vector_n.h.

110 : _start(v1), _end(v2) {}
Real * _end
Definition: Vector_n.h:181
Real * _start
Definition: Vector_n.h:181
Array_n ( const Self v)
inline

Definition at line 111 of file Vector_n.h.

111 : _start(v._start), _end(v._end) {}
Real * _end
Definition: Vector_n.h:181
*********************************************************************Illinois Open Source License ****University of Illinois NCSA **Open Source License University of Illinois All rights reserved ****Developed free of to any person **obtaining a copy of this software and associated documentation to deal with the Software without including without limitation the rights to and or **sell copies of the and to permit persons to whom the **Software is furnished to do subject to the following this list of conditions and the following disclaimers ****Redistributions in binary form must reproduce the above **copyright this list of conditions and the following **disclaimers in the documentation and or other materials **provided with the distribution ****Neither the names of the Center for Simulation of Advanced the University of nor the names of its **contributors may be used to endorse or promote products derived **from this Software without specific prior written permission ****THE SOFTWARE IS PROVIDED AS WITHOUT WARRANTY OF ANY **EXPRESS OR INCLUDING BUT NOT LIMITED TO THE WARRANTIES **OF FITNESS FOR A PARTICULAR PURPOSE AND **NONINFRINGEMENT IN NO EVENT SHALL THE CONTRIBUTORS OR **COPYRIGHT HOLDERS BE LIABLE FOR ANY DAMAGES OR OTHER WHETHER IN AN ACTION OF TORT OR **ARISING OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE **USE OR OTHER DEALINGS WITH THE SOFTWARE v
Definition: roccomf90.h:20
Real * _start
Definition: Vector_n.h:181

Member Function Documentation

Const_pointer begin ( ) const
inline

Definition at line 121 of file Vector_n.h.

References _start.

Referenced by RFC_Window_transfer::allreduce().

121 { return _start; }
Real * _start
Definition: Vector_n.h:181

Here is the caller graph for this function:

Pointer begin ( )
inline

Definition at line 123 of file Vector_n.h.

References _start.

123 { return _start; }
Real * _start
Definition: Vector_n.h:181
Size dimension ( ) const
inline

Definition at line 119 of file Vector_n.h.

References _end, and _start.

Referenced by Transfer_base::element_load_vector(), and Vector_n::Vector_n().

119 { return _end-_start; }
Real * _end
Definition: Vector_n.h:181
Real * _start
Definition: Vector_n.h:181

Here is the caller graph for this function:

Const_pointer end ( ) const
inline

Definition at line 122 of file Vector_n.h.

References _end.

Referenced by RFC_Window_transfer::allreduce().

122 { return _end; }
Real * _end
Definition: Vector_n.h:181

Here is the caller graph for this function:

Pointer end ( )
inline

Definition at line 124 of file Vector_n.h.

References _end.

124 { return _end; }
Real * _end
Definition: Vector_n.h:181
Self& invert ( )
inline

Definition at line 175 of file Vector_n.h.

References _end, and _start.

Referenced by Transfer_base::invert(), and Vector_n::invert().

175  {
176  for ( Real *p=_start; p!=_end; ++p) { *p = (*p==0) ? 0. : 1. / *p; }
177  return *this;
178  }
Real * _end
Definition: Vector_n.h:181
double Real
Definition: mapbasic.h:322
Real * _start
Definition: Vector_n.h:181

Here is the caller graph for this function:

operator const Array_n_const & ( ) const
inline

Definition at line 113 of file Vector_n.h.

114  { return reinterpret_cast< const Array_n_const&>(*this); }
Self& operator*= ( Real  t)
inline

Definition at line 152 of file Vector_n.h.

References _end, and _start.

Referenced by Vector_n::operator*=().

152  {
153  for ( Real *p=_start; p!=_end; ++p) *p *= t; return *this;
154  }
Real * _end
Definition: Vector_n.h:181
double Real
Definition: mapbasic.h:322
Real * _start
Definition: Vector_n.h:181

Here is the caller graph for this function:

Self& operator*= ( const Array_n_const v1)
inline

Definition at line 156 of file Vector_n.h.

References Array_n_const::_end, _end, Array_n_const::_start, _start, q, and RFC_assertion.

156  {
157  RFC_assertion( _end-_start == v1._end-v1._start);
158  const Real *q=v1._start;
159  for ( Real *p=_start; p!=_end; ++p, ++q) *p *= *q;
160  return *this;
161  }
Real * _end
Definition: Vector_n.h:181
const Real * _start
Definition: Vector_n.h:91
double Real
Definition: mapbasic.h:322
const Real * _end
Definition: Vector_n.h:91
Real * _start
Definition: Vector_n.h:181
NT q
#define RFC_assertion
Definition: rfc_basic.h:65
Self& operator+= ( const Array_n_const v1)
inline

Definition at line 138 of file Vector_n.h.

References Array_n_const::_end, _end, Array_n_const::_start, _start, q, and RFC_assertion.

Referenced by Vector_n::operator+=().

138  {
139  RFC_assertion( _end-_start == v1._end-v1._start);
140  const Real *q=v1._start;
141  for ( Real *p=_start; p!=_end; ++p, ++q) *p += *q;
142  return *this;
143  }
Real * _end
Definition: Vector_n.h:181
const Real * _start
Definition: Vector_n.h:91
double Real
Definition: mapbasic.h:322
const Real * _end
Definition: Vector_n.h:91
Real * _start
Definition: Vector_n.h:181
NT q
#define RFC_assertion
Definition: rfc_basic.h:65

Here is the caller graph for this function:

Self& operator-= ( const Array_n_const v1)
inline

Definition at line 145 of file Vector_n.h.

References Array_n_const::_end, _end, Array_n_const::_start, _start, q, and RFC_assertion.

Referenced by Vector_n::operator-=().

145  {
146  RFC_assertion( _end-_start == v1._end-v1._start);
147  const Real *q=v1._start;
148  for ( Real *p=_start; p!=_end; ++p, ++q) *p -= *q;
149  return *this;
150  }
Real * _end
Definition: Vector_n.h:181
const Real * _start
Definition: Vector_n.h:91
double Real
Definition: mapbasic.h:322
const Real * _end
Definition: Vector_n.h:91
Real * _start
Definition: Vector_n.h:181
NT q
#define RFC_assertion
Definition: rfc_basic.h:65

Here is the caller graph for this function:

Self& operator/= ( Real  t)
inline

Definition at line 163 of file Vector_n.h.

References _end, and _start.

Referenced by Vector_n::operator/=().

163  {
164  for ( Real *p=_start; p!=_end; ++p) { *p = (t==0) ? 1. : *p / t; }
165  return *this;
166  }
Real * _end
Definition: Vector_n.h:181
double Real
Definition: mapbasic.h:322
Real * _start
Definition: Vector_n.h:181

Here is the caller graph for this function:

Self& operator/= ( const Array_n_const v1)
inline

Definition at line 168 of file Vector_n.h.

References Array_n_const::_end, _end, Array_n_const::_start, _start, q, and RFC_assertion.

168  {
169  RFC_assertion( _end-_start == v1._end-v1._start);
170  const Real *q=v1._start;
171  for ( Real *p=_start; p!=_end; ++p, ++q) { *p = (*q==0) ? 1. : *p / *q; }
172  return *this;
173  }
Real * _end
Definition: Vector_n.h:181
const Real * _start
Definition: Vector_n.h:91
double Real
Definition: mapbasic.h:322
const Real * _end
Definition: Vector_n.h:91
Real * _start
Definition: Vector_n.h:181
NT q
#define RFC_assertion
Definition: rfc_basic.h:65
Self& operator= ( const Array_n_const v)
inline

Definition at line 128 of file Vector_n.h.

References Array_n_const::_end, _end, Array_n_const::_start, _start, copy, and RFC_assertion.

Referenced by Vector_n::operator=().

128  {
129  if ( _start != v._start) { // Check not assigning to itself.
131  std::copy( v._start,v._end,_start);
132  }
133  return *this;
134  }
Real * _end
Definition: Vector_n.h:181
const Real * _start
Definition: Vector_n.h:91
*********************************************************************Illinois Open Source License ****University of Illinois NCSA **Open Source License University of Illinois All rights reserved ****Developed free of to any person **obtaining a copy of this software and associated documentation to deal with the Software without including without limitation the rights to ** copy
Definition: roccomf90.h:20
const Real * _end
Definition: Vector_n.h:91
Real * _start
Definition: Vector_n.h:181
#define RFC_assertion
Definition: rfc_basic.h:65

Here is the caller graph for this function:

Array_n & operator= ( const Self v)
inline

Definition at line 267 of file Vector_n.h.

267  {
268  return *this = (const Array_n_const&)v;
269 }
*********************************************************************Illinois Open Source License ****University of Illinois NCSA **Open Source License University of Illinois All rights reserved ****Developed free of to any person **obtaining a copy of this software and associated documentation to deal with the Software without including without limitation the rights to and or **sell copies of the and to permit persons to whom the **Software is furnished to do subject to the following this list of conditions and the following disclaimers ****Redistributions in binary form must reproduce the above **copyright this list of conditions and the following **disclaimers in the documentation and or other materials **provided with the distribution ****Neither the names of the Center for Simulation of Advanced the University of nor the names of its **contributors may be used to endorse or promote products derived **from this Software without specific prior written permission ****THE SOFTWARE IS PROVIDED AS WITHOUT WARRANTY OF ANY **EXPRESS OR INCLUDING BUT NOT LIMITED TO THE WARRANTIES **OF FITNESS FOR A PARTICULAR PURPOSE AND **NONINFRINGEMENT IN NO EVENT SHALL THE CONTRIBUTORS OR **COPYRIGHT HOLDERS BE LIABLE FOR ANY DAMAGES OR OTHER WHETHER IN AN ACTION OF TORT OR **ARISING OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE **USE OR OTHER DEALINGS WITH THE SOFTWARE v
Definition: roccomf90.h:20
Array_n & operator= ( const Vector_n v)
inline

Definition at line 270 of file Vector_n.h.

270  {
271  return *this = (const Array_n_const&)v;
272 }
Reference operator[] ( Size  i)
inline

Definition at line 116 of file Vector_n.h.

References _start, and i.

116 { return _start[i]; }
blockLoc i
Definition: read.cpp:79
Real * _start
Definition: Vector_n.h:181
Const_reference operator[] ( Size  i) const
inline

Definition at line 117 of file Vector_n.h.

References _start, and i.

117 { return _start[i]; }
blockLoc i
Definition: read.cpp:79
Real * _start
Definition: Vector_n.h:181
Real squared_norm ( ) const
inline

Definition at line 126 of file Vector_n.h.

126 { return ((Array_n_const*)this)->squared_norm(); }

Friends And Related Function Documentation

friend class Vector_n
friend

Definition at line 106 of file Vector_n.h.

Member Data Documentation


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