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

#include <Vector_n.h>

Public Types

typedef Array_n_const 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_const ()
 
 Array_n_const (const Real *v, Size n)
 
 Array_n_const (const Real *v1, const Real *v2)
 
 Array_n_const (const Self &v)
 
Const_reference operator[] (Size i) const
 
Size dimension () const
 
Const_pointer begin () const
 
Const_pointer end () const
 
Real squared_norm () const
 

Protected Member Functions

Selfoperator= (const Self &)
 

Protected Attributes

const Real_start
 
const Real_end
 

Friends

class Array_n
 
class Vector_n
 
bool operator== (const Array_n_const &v1, const Array_n_const &v2)
 
Vector_n operator+ (const Array_n_const &v1, const Array_n_const &v2)
 
Vector_n operator- (const Array_n_const &v1, const Array_n_const &v2)
 
Real operator* (const Array_n_const &v1, const Array_n_const &v2)
 
Vector_n operator* (Real a, const Array_n_const &v1)
 
Vector_n operator* (const Array_n_const &v1, Real a)
 
Vector_n operator/ (const Array_n_const &v1, Real a)
 
Vector_n multiply (const Array_n_const &v1, const Array_n_const &v2)
 
Vector_n divide (const Array_n_const &v1, const Array_n_const &v2)
 
Vector_n min (const Array_n_const &v1, const Array_n_const &v2)
 
Vector_n max (const Array_n_const &v1, const Array_n_const &v2)
 

Detailed Description

Definition at line 48 of file Vector_n.h.

Member Typedef Documentation

typedef Real const* Const_pointer

Definition at line 53 of file Vector_n.h.

typedef const Real& Const_reference

Definition at line 55 of file Vector_n.h.

typedef Real* Pointer

Definition at line 52 of file Vector_n.h.

typedef Real& Reference

Definition at line 54 of file Vector_n.h.

Definition at line 50 of file Vector_n.h.

typedef unsigned int Size

Definition at line 56 of file Vector_n.h.

typedef Real Value

Definition at line 51 of file Vector_n.h.

Constructor & Destructor Documentation

Array_n_const ( )
inline

Definition at line 72 of file Vector_n.h.

72 : _start(0), _end(0) {}
const Real * _start
Definition: Vector_n.h:91
const Real * _end
Definition: Vector_n.h:91
Array_n_const ( const Real v,
Size  n 
)
inline

Definition at line 73 of file Vector_n.h.

73 : _start(v), _end(v+n) { }
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 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
const Real * _end
Definition: Vector_n.h:91
Array_n_const ( const Real v1,
const Real v2 
)
inline

Definition at line 74 of file Vector_n.h.

74 : _start(v1), _end(v2) { }
const Real * _start
Definition: Vector_n.h:91
const Real * _end
Definition: Vector_n.h:91
Array_n_const ( const Self v)
inline

Definition at line 75 of file Vector_n.h.

75 : _start(v._start), _end(v._end) {}
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 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 Real * _end
Definition: Vector_n.h:91

Member Function Documentation

Const_pointer begin ( ) const
inline

Definition at line 81 of file Vector_n.h.

References _start.

Referenced by operator<<(), and RFC_Data< _Tag >::set_value().

81 { return _start; }
const Real * _start
Definition: Vector_n.h:91

Here is the caller graph for this function:

Size dimension ( ) const
inline

Definition at line 79 of file Vector_n.h.

References _end, and _start.

Referenced by Transfer_base::minmax(), RFC_Data< _Tag >::set_value(), and Vector_n::Vector_n().

79 { return _end-_start; }
const Real * _start
Definition: Vector_n.h:91
const Real * _end
Definition: Vector_n.h:91

Here is the caller graph for this function:

Const_pointer end ( ) const
inline

Definition at line 82 of file Vector_n.h.

References _end.

Referenced by operator<<(), and RFC_Data< _Tag >::set_value().

82 { return _end; }
const Real * _end
Definition: Vector_n.h:91

Here is the caller graph for this function:

Self& operator= ( const Self )
protected
Const_reference operator[] ( Size  i) const
inline

Definition at line 77 of file Vector_n.h.

References _start, and i.

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

Definition at line 84 of file Vector_n.h.

References _end, and _start.

84  {
85  Real t=0;
86  for ( const Real *p=_start; p!=_end; ++p) t += *p * *p;
87  return t;
88  }
const Real * _start
Definition: Vector_n.h:91
double Real
Definition: mapbasic.h:322
const Real * _end
Definition: Vector_n.h:91

Friends And Related Function Documentation

friend class Array_n
friend

Definition at line 58 of file Vector_n.h.

Vector_n divide ( const Array_n_const v1,
const Array_n_const v2 
)
friend

Definition at line 338 of file Vector_n.h.

338  {
339  RFC_assertion( v1._end-v1._start == v2._end-v2._start);
340  Vector_n v3( v1._end-v1._start);
341  const Real *p=v1._start, *q=v2._start;
342  for ( Real *r=v3._start; p!=v1._end; ++p, ++q, ++r) *r = (*q==0)? 1. : *p / *q;
343  return v3;
344 }
const Real * _start
Definition: Vector_n.h:91
double Real
Definition: mapbasic.h:322
const Real * _end
Definition: Vector_n.h:91
NT q
#define RFC_assertion
Definition: rfc_basic.h:65
Vector_n max ( const Array_n_const v1,
const Array_n_const v2 
)
friend

Definition at line 354 of file Vector_n.h.

354  {
355  RFC_assertion( v1._end-v1._start == v2._end-v2._start);
356  Vector_n v3( v1._end-v1._start);
357  const Real *p=v1._start, *q=v2._start;
358  for ( Real *r=v3._start; p!=v1._end; ++p, ++q, ++r) *r = std::max(*p,*q);
359  return v3;
360 }
Vector_n max(const Array_n_const &v1, const Array_n_const &v2)
Definition: Vector_n.h:354
const Real * _start
Definition: Vector_n.h:91
double Real
Definition: mapbasic.h:322
const Real * _end
Definition: Vector_n.h:91
NT q
#define RFC_assertion
Definition: rfc_basic.h:65
Vector_n min ( const Array_n_const v1,
const Array_n_const v2 
)
friend

Definition at line 346 of file Vector_n.h.

346  {
347  RFC_assertion( v1._end-v1._start == v2._end-v2._start);
348  Vector_n v3( v1._end-v1._start);
349  const Real *p=v1._start, *q=v2._start;
350  for ( Real *r=v3._start; p!=v1._end; ++p, ++q, ++r) *r = std::min(*p,*q);
351  return v3;
352 }
const Real * _start
Definition: Vector_n.h:91
double Real
Definition: mapbasic.h:322
const Real * _end
Definition: Vector_n.h:91
Vector_n min(const Array_n_const &v1, const Array_n_const &v2)
Definition: Vector_n.h:346
NT q
#define RFC_assertion
Definition: rfc_basic.h:65
Vector_n multiply ( const Array_n_const v1,
const Array_n_const v2 
)
friend

Definition at line 330 of file Vector_n.h.

330  {
331  RFC_assertion( v1._end-v1._start == v2._end-v2._start);
332  Vector_n v3( v1._end-v1._start);
333  const Real *p=v1._start, *q=v2._start;
334  for ( Real *r=v3._start; p!=v1._end; ++p, ++q, ++r) *r = *p * *q;
335  return v3;
336 }
const Real * _start
Definition: Vector_n.h:91
double Real
Definition: mapbasic.h:322
const Real * _end
Definition: Vector_n.h:91
NT q
#define RFC_assertion
Definition: rfc_basic.h:65
Real operator* ( const Array_n_const v1,
const Array_n_const v2 
)
friend

Definition at line 300 of file Vector_n.h.

300  {
301  RFC_assertion( v1._end-v1._start == v2._end-v2._start);
302  Real t(0);
303 
304  for ( const Real *p=v1._start, *q=v2._start; p!=v1._end; ++p, ++q)
305  t += *p * *q;
306  return t;
307 }
const Real * _start
Definition: Vector_n.h:91
double Real
Definition: mapbasic.h:322
const Real * _end
Definition: Vector_n.h:91
NT q
#define RFC_assertion
Definition: rfc_basic.h:65
Vector_n operator* ( Real  a,
const Array_n_const v1 
)
friend

Definition at line 309 of file Vector_n.h.

309  {
310  Vector_n v2( v1._end-v1._start);
311  const Real *p=v1._start;
312  for ( Real *q=v2._start; p!=v1._end; ++p, ++q) *q = a * *p;
313  return v2;
314 }
const Real * _start
Definition: Vector_n.h:91
double Real
Definition: mapbasic.h:322
const Real * _end
Definition: Vector_n.h:91
NT q
Vector_n operator* ( const Array_n_const v1,
Real  a 
)
friend

Definition at line 316 of file Vector_n.h.

316  {
317  Vector_n v2( v1._end-v1._start);
318  const Real *p=v1._start;
319  for ( Real *q=v2._start; p!=v1._end; ++p, ++q) *q = a * *p;
320  return v2;
321 }
const Real * _start
Definition: Vector_n.h:91
double Real
Definition: mapbasic.h:322
const Real * _end
Definition: Vector_n.h:91
NT q
Vector_n operator+ ( const Array_n_const v1,
const Array_n_const v2 
)
friend

Definition at line 282 of file Vector_n.h.

282  {
283  RFC_assertion( v1._end-v1._start == v2._end-v2._start);
284  Vector_n v3( v1._end-v1._start);
285  const Real *p=v1._start, *q=v2._start;
286  for ( Real *r=v3._start; p!=v1._end; ++p, ++q, ++r) *r = *p + *q;
287  return v3;
288 }
const Real * _start
Definition: Vector_n.h:91
double Real
Definition: mapbasic.h:322
const Real * _end
Definition: Vector_n.h:91
NT q
#define RFC_assertion
Definition: rfc_basic.h:65
Vector_n operator- ( const Array_n_const v1,
const Array_n_const v2 
)
friend

Definition at line 290 of file Vector_n.h.

290  {
291  RFC_assertion( v1._end-v1._start == v2._end-v2._start);
292  Vector_n v3( v1._end-v1._start);
293 
294  const Real *p=v1._start, *q=v2._start;
295  for ( Real *r=v3._start; p!=v1._end; ++p, ++q, ++r)
296  *r = *p - *q;
297  return v3;
298 }
const Real * _start
Definition: Vector_n.h:91
double Real
Definition: mapbasic.h:322
const Real * _end
Definition: Vector_n.h:91
NT q
#define RFC_assertion
Definition: rfc_basic.h:65
Vector_n operator/ ( const Array_n_const v1,
Real  a 
)
friend

Definition at line 323 of file Vector_n.h.

323  {
324  Vector_n v2( v1._end-v1._start);
325  const Real *p=v1._start;
326  for ( Real *q=v2._start; p!=v1._end; ++p, ++q) *q = (a==0) ? 1.: *p / a;
327  return v2;
328 }
const Real * _start
Definition: Vector_n.h:91
double Real
Definition: mapbasic.h:322
const Real * _end
Definition: Vector_n.h:91
NT q
bool operator== ( const Array_n_const v1,
const Array_n_const v2 
)
friend

Definition at line 274 of file Vector_n.h.

274  {
275  if ( v1._end-v1._start != v2._end-v2._start) return false;
276  for ( const Real *p=v1._start, *q=v2._start; p!=v1._end; ++p,++q) {
277  if ( *p != *q) return false;
278  }
279  return true;
280 }
const Real * _start
Definition: Vector_n.h:91
double Real
Definition: mapbasic.h:322
const Real * _end
Definition: Vector_n.h:91
NT q
friend class Vector_n
friend

Definition at line 59 of file Vector_n.h.

Member Data Documentation


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