3 #ifndef GAUDIKERNEL_NTUPLE_H
4 #define GAUDIKERNEL_NTUPLE_H
24 class NTupleDirectory;
37 template <
class TYP>
class Range;
38 template <
class TYP>
class _Data;
39 template <
class TYP>
class _Item;
43 template <
class TYP>
class Item;
44 template <
class TYP>
class Array;
86 Range(
const bool ,
const bool ) {}
92 bool lower()
const {
return false; }
94 bool upper()
const {
return true; }
98 static bool min() {
return false; }
100 static bool max() {
return true; }
120 virtual void setDefault(
const TYP d) = 0;
141 *this->m_buffer = copy.
get();
145 void set(
const TYP&
item) { *this->m_buffer =
item; }
147 virtual TYP
get()
const {
return *this->m_buffer; }
166 long len = this->length();
167 if ( len == copy.
length() ) {
168 const T* source = (
const T*)copy.
buffer();
169 for (
int i = 0;
i < len;
i++ ) {
170 *(this->m_buffer +
i) = *(source +
i);
175 (
"N-tuple matrix cannot be copied! The index range does not match!");
179 const TYP&
data(
long i)
const {
return *(this->m_buffer +
i); }
181 TYP&
data(
long i) {
return *(this->m_buffer +
i); }
204 long len = this->length();
205 if ( len == copy.
length() ) {
206 const T* source = (
const T*)copy.
buffer();
207 for (
int i = 0;
i < len;
i++ ) {
208 *(this->m_buffer +
i) = *(source +
i);
213 (
"N-tuple matrix cannot be copied! The index range does not match!");
217 TYP*
column(
long i) {
return (this->m_buffer + i*m_rows); }
219 const TYP*
column(
long i)
const {
return (this->m_buffer + i*m_rows); }
241 operator const void*()
const {
return m_ptr; }
258 operator const TYP ()
const {
return this->
m_ptr->get(); }
270 this->
m_ptr->set( data );
276 this->
m_ptr->set( data->get() );
280 this->
m_ptr->set ( this->
m_ptr->get() + data );
284 this->
m_ptr->set ( this->
m_ptr->get() - data );
288 this->
m_ptr->set ( this->
m_ptr->get() * data );
292 this->
m_ptr->set ( this->
m_ptr->get() / data );
305 operator bool ()
const {
return this->
m_ptr->get(); }
308 this->
m_ptr->set( data );
314 this->
m_ptr->set( data->get() );
328 *(this->
m_ptr) = *(copy.operator->());
349 *(this->
m_ptr) = *(copy.operator->());
431 template <
class TYPE>
446 template <
class TYPE>
466 template <
class TYPE>
699 template <
class TYPE,
class INDEX,
class RANGE>
StatusCode
707 index->
range().distance(),
739 template <
class TYPE,
class INDEX,
class RANGE>
StatusCode
747 index->
range().distance(),
784 index->
range().distance(),
816 index->
range().distance(),
926 index->
range().distance(),
961 col_index->
range().distance(),
1001 template <
class TYPE,
class INDEX,
class RANGE>
StatusCode
1010 index->
range().distance(),
1045 template <
class TYPE,
class INDEX,
class RANGE>
StatusCode
1054 index->
range().distance(),
1156 virtual void dummy() = 0;
1165 virtual void dummy() = 0;
1168 #ifndef ALLOW_ALL_TYPES
1219 #endif // GAUDIKERNEL_NTUPLE_H