Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Three_tuple< T > Struct Template Reference

#include <Tuple.h>

Inheritance diagram for Three_tuple< T >:

Public Types

typedef Tuple_traits< T > Traits
 
typedef Traits::Value Value
 
typedef Traits::Value_opposite Value_opposite
 
typedef Traits::Pointer Pointer
 
typedef Traits::Const_pointer Const_pointer
 
typedef Traits::Reference Reference
 
typedef Traits::Const_reference Const_reference
 
typedef Traits::Init_reference Init_reference
 
typedef Traits::Pointer_equivalent Pointer_equivalent
 
typedef Three_tuple< T > Self
 
typedef const Three_tuple
< Value_opposite
Const_self
 

Public Member Functions

 Three_tuple ()
 
 Three_tuple (Init_reference p, Init_reference q, Init_reference r)
 
 Three_tuple (Const_reference t)
 
bool operator== (const Self &x) const
 
bool operator!= (const Self &x) const
 
Const_reference operator[] (int i) const
 
Reference operator[] (int i)
 
int id () const
 
int dimension () const
 
std::ostream & print (std::ostream &os, const char *s) const
 
 operator Const_self & () const
 
Self operator+ (const Self &t) const
 
Self operator- (const Self &t) const
 
Selfoperator+= (const Self &t)
 
Selfoperator-= (const Self &t)
 
Value operator* (const Self &t) const
 
Selfoperator*= (Const_reference t)
 
Self operator/ (Const_reference t) const
 
Selfoperator/= (Const_reference t)
 
Self multiply (const Self &b) const
 
Self divide (const Self &b) const
 

Protected Attributes

Value v0
 
Value v1
 
Value v2
 

Detailed Description

template<class T>
struct Three_tuple< T >

Definition at line 245 of file Tuple.h.

Member Typedef Documentation

Definition at line 250 of file Tuple.h.

Definition at line 252 of file Tuple.h.

Definition at line 257 of file Tuple.h.

Definition at line 253 of file Tuple.h.

Definition at line 249 of file Tuple.h.

Definition at line 254 of file Tuple.h.

Definition at line 251 of file Tuple.h.

typedef Three_tuple<T> Self

Definition at line 256 of file Tuple.h.

typedef Tuple_traits<T> Traits

Definition at line 246 of file Tuple.h.

Definition at line 247 of file Tuple.h.

Definition at line 248 of file Tuple.h.

Constructor & Destructor Documentation

Three_tuple ( )
inline

Definition at line 259 of file Tuple.h.

259 {}

Definition at line 260 of file Tuple.h.

261  : v0(p), v1(q), v2(r) {}
Value v0
Definition: Tuple.h:329
Value v1
Definition: Tuple.h:330
NT q
Value v2
Definition: Tuple.h:331
Three_tuple ( Const_reference  t)
inlineexplicit

Definition at line 262 of file Tuple.h.

262 : v0(t), v1(t), v2(t) {}
Value v0
Definition: Tuple.h:329
Value v1
Definition: Tuple.h:330
Value v2
Definition: Tuple.h:331

Member Function Documentation

int dimension ( ) const
inline

Definition at line 278 of file Tuple.h.

278 { return 3; }
Self divide ( const Self b) const
inline

Definition at line 323 of file Tuple.h.

323  {
324  return Self( b.v0==Value(0) ? Value(0) : v0 /b.v0,
325  b.v1==Value(0) ? Value(0) : v1 /b.v1,
326  b.v2==Value(0) ? Value(0) : v2 /b.v2);
327  }
Value v0
Definition: Tuple.h:329
Three_tuple< T > Self
Definition: Tuple.h:256
Value v1
Definition: Tuple.h:330
Value v2
Definition: Tuple.h:331
Traits::Value Value
Definition: Tuple.h:247
int id ( ) const
inline

Definition at line 277 of file Tuple.h.

277 { return static_cast<int>(this); }
Self multiply ( const Self b) const
inline

Definition at line 319 of file Tuple.h.

319  {
320  return Self( v0 *b.v0, v1 *b.v1, v2 *b.v2);
321  }
Value v0
Definition: Tuple.h:329
Three_tuple< T > Self
Definition: Tuple.h:256
Value v1
Definition: Tuple.h:330
Value v2
Definition: Tuple.h:331
operator Const_self & ( ) const
inline

Definition at line 292 of file Tuple.h.

293  { return reinterpret_cast<Const_self&>(*this); }
const Three_tuple< Value_opposite > Const_self
Definition: Tuple.h:257
bool operator!= ( const Self x) const
inline

Definition at line 266 of file Tuple.h.

267  { return v0!=x.v0 || v1!=x.v1 || v2!=x.v2; }
Value v0
Definition: Tuple.h:329
void int int REAL * x
Definition: read.cpp:74
Value v1
Definition: Tuple.h:330
Value v2
Definition: Tuple.h:331
Value operator* ( const Self t) const
inline

Definition at line 307 of file Tuple.h.

308  { return v0*t.v0+v1*t.v1+v2*t.v2; }
Value v0
Definition: Tuple.h:329
Value v1
Definition: Tuple.h:330
Value v2
Definition: Tuple.h:331
Self& operator*= ( Const_reference  t)
inline

Definition at line 310 of file Tuple.h.

311  { v0*=t; v1*=t; v2*=t; return *this; }
Value v0
Definition: Tuple.h:329
Value v1
Definition: Tuple.h:330
Value v2
Definition: Tuple.h:331
Self operator+ ( const Self t) const
inline

Definition at line 295 of file Tuple.h.

296  { return Self( v0+t.v0, v1+t.v1, v2+t.v2); }
Value v0
Definition: Tuple.h:329
Three_tuple< T > Self
Definition: Tuple.h:256
Value v1
Definition: Tuple.h:330
Value v2
Definition: Tuple.h:331
Self& operator+= ( const Self t)
inline

Definition at line 301 of file Tuple.h.

302  { v0+=t.v0; v1+=t.v1; v2+=t.v2; return *this; }
Value v0
Definition: Tuple.h:329
Value v1
Definition: Tuple.h:330
Value v2
Definition: Tuple.h:331
Self operator- ( const Self t) const
inline

Definition at line 298 of file Tuple.h.

299  { return Self( v0-t.v0, v1-t.v1, v2-t.v2); }
Value v0
Definition: Tuple.h:329
Three_tuple< T > Self
Definition: Tuple.h:256
Value v1
Definition: Tuple.h:330
Value v2
Definition: Tuple.h:331
Self& operator-= ( const Self t)
inline

Definition at line 304 of file Tuple.h.

305  { v0-=t.v0; v1-=t.v1; v2-=t.v2; return *this; }
Value v0
Definition: Tuple.h:329
Value v1
Definition: Tuple.h:330
Value v2
Definition: Tuple.h:331
Self operator/ ( Const_reference  t) const
inline

Definition at line 313 of file Tuple.h.

314  { return Self( v0/t, v1/t, v2/t); }
Value v0
Definition: Tuple.h:329
Three_tuple< T > Self
Definition: Tuple.h:256
Value v1
Definition: Tuple.h:330
Value v2
Definition: Tuple.h:331
Self& operator/= ( Const_reference  t)
inline

Definition at line 316 of file Tuple.h.

317  { v0/=t; v1/=t; v2/=t; return *this; }
Value v0
Definition: Tuple.h:329
Value v1
Definition: Tuple.h:330
Value v2
Definition: Tuple.h:331
bool operator== ( const Self x) const
inline

Definition at line 264 of file Tuple.h.

265  { return v0==x.v0 && v1==x.v1 && v2==x.v2; }
Value v0
Definition: Tuple.h:329
void int int REAL * x
Definition: read.cpp:74
Value v1
Definition: Tuple.h:330
Value v2
Definition: Tuple.h:331
Const_reference operator[] ( int  i) const
inline

Definition at line 269 of file Tuple.h.

269  {
270  return Traits::ref(reinterpret_cast<Pointer_equivalent>
271  (const_cast<Self*>(this))+i);
272  }
static Reference ref(Pointer_equivalent p)
Definition: Tuple.h:42
blockLoc i
Definition: read.cpp:79
Reference operator[] ( int  i)
inline

Definition at line 273 of file Tuple.h.

273  {
274  return Traits::ref(reinterpret_cast<Pointer_equivalent>(this)+i);
275  }
static Reference ref(Pointer_equivalent p)
Definition: Tuple.h:42
blockLoc i
Definition: read.cpp:79
std::ostream& print ( std::ostream &  os,
const char *  s 
) const
inline

Definition at line 280 of file Tuple.h.

280  {
281  switch(os.iword(IO::mode)) {
282  case IO::ASCII :
283  return os << v0 << ' ' << v1 << ' ' << v2;
284  case IO::BINARY :
285  return os << v0 << v1 << v2;
286  default:
287  return os << s << "(" << v0 << ' ' << v1
288  << ' ' << v2 << ' ' << ")";
289  }
290  }
Value v0
Definition: Tuple.h:329
double s
Definition: blastest.C:80
Definition: io.h:64
static int mode
Definition: io.h:63
Definition: io.h:64
Value v1
Definition: Tuple.h:330
Value v2
Definition: Tuple.h:331

Member Data Documentation


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