Commit 2b2f41af authored by thomas.forbriger's avatar thomas.forbriger Committed by thomas.forbriger
Browse files

some improving corrections

This is a legacy commit from before 2015-03-01.
It may be incomplete as well as inconsistent.
See COPYING.legacy and README.history for details.


SVN Path:     http://gpitrsvn.gpi.uni-karlsruhe.de/repos/TFSoftware/trunk
SVN Revision: 1251
SVN UUID:     67feda4a-a26e-11df-9d6e-31afc202ad0c
parent aa9f4e61
......@@ -3,7 +3,7 @@
*
* ----------------------------------------------------------------------------
*
* $Id: README.changelog,v 1.28 2002-12-31 15:56:45 forbrig Exp $
* $Id: README.changelog,v 1.29 2002-12-31 17:19:46 forbrig Exp $
*
* Copyright (c) 2002 by Thomas Forbriger (IMG Frankfurt)
*
......@@ -21,7 +21,7 @@
/*! \page page_changelog ChangeLog (AFF)
$Id: README.changelog,v 1.28 2002-12-31 15:56:45 forbrig Exp $
$Id: README.changelog,v 1.29 2002-12-31 17:19:46 forbrig Exp $
\sa \ref page_project_status
......@@ -30,6 +30,13 @@
- \b 31/12/2002 (thof)
- NULL is deprecated as pointed out by Wolfgang (replaced by literal 0 in
lib/error.cc and lib/sharedheap_def.h)
- Removed non-initializing constructors in aff::ConstArray and
aff::ConstSeries (except default constructor, which is needed, when
object is a container's element) as suggested by Wolfgang.
- removed constructor from Theadstruct in aff::ConstSharedHeap
- made the non-initializing constructor aff::ConstSharedHeap
protected. Default constructor remains public (it is needed if we
construct a container for ConstSharedHeap elements).
- \b 29/12/2002 (thof)
- aff::ConstArray and aff::ConstSeries now inherit from
......@@ -141,7 +148,7 @@
/*! \page page_project_status Project status (AFF)
$Id: README.changelog,v 1.28 2002-12-31 15:56:45 forbrig Exp $
$Id: README.changelog,v 1.29 2002-12-31 17:19:46 forbrig Exp $
\sa \ref page_changelog
......@@ -187,7 +194,10 @@
<TD> </TD>
</TR>
<TR><TD>libaff/series.h</TD>
<TD>17/12/02</TD><TD> </TD><TD> </TD><TD> </TD>
<TD>17/12/02</TD><TD> </TD><TD> </TD>
<TD>There is a constructor resolution conflict due to default
arguments. <B>Resolving this will affect the interface
definition</B></TD>
</TR>
<TR><TD>libaff/shaper.h</TD>
<TD>12/12/02</TD><TD> </TD><TD>18/12/02</TD><TD> </TD>
......
......@@ -3,7 +3,7 @@
*
* ----------------------------------------------------------------------------
*
* $Id: array_dec.h,v 1.19 2002-12-29 23:02:15 forbrig Exp $
* $Id: array_dec.h,v 1.20 2002-12-31 17:19:46 forbrig Exp $
* \author Thomas Forbriger
* \since 08/12/2002
*
......@@ -49,6 +49,11 @@
* code looks much simpler now
* - member template must be defined here
* - factored out copyin code
* - 31/12/2002 V1.8 (thof)
* - Removed non-initializing constructors in
* ConstArray (except default constructor, which is
* needed, when object is a container element) as
* suggested by Wolfgang.
*
* ============================================================================
*/
......@@ -57,9 +62,9 @@
#ifndef AFF_ARRAY_DEC_H_VERSION
#define AFF_ARRAY_DEC_H_VERSION \
"AFF_ARRAY_DEC_H V1.7"
"AFF_ARRAY_DEC_H V1.8"
#define AFF_ARRAY_DEC_H_CVSID \
"$Id: array_dec.h,v 1.19 2002-12-29 23:02:15 forbrig Exp $"
"$Id: array_dec.h,v 1.20 2002-12-31 17:19:46 forbrig Exp $"
#include <aff/lib/sharedheap.h>
#include <aff/lib/strided.h>
......@@ -154,16 +159,6 @@ namespace prebuilt {
const Trepresentation& representation):
Tshape(shape), Mrepresentation(representation)
{ check_consistency(); }
//! construct from shape (defines size and layout)
explicit ConstArray(const Tshape& shape):
Tshape(shape.first(),shape.last()),
Mrepresentation(this->Tshape::memory_size())
{ check_consistency(); }
//! construct from dimension sizes
explicit ConstArray(const Tsize& s0, const Tsize& s1=1,
const Tsize& s2=1, const Tsize& s3=1):
Tshape(s0, s1, s2, s3),
Mrepresentation(this->Tshape::memory_size()) { }
//@}
/*-----------------------------------------------------------------*/
......
......@@ -3,7 +3,7 @@
*
* ----------------------------------------------------------------------------
*
* $Id: sharedheap.h,v 1.14 2002-12-29 23:02:16 forbrig Exp $
* $Id: sharedheap.h,v 1.15 2002-12-31 17:19:47 forbrig Exp $
* \author Thomas Forbriger
* \since 08/12/2002
*
......@@ -31,6 +31,12 @@
* - use "using" syntax for access declarations
* - resolved conflicts with protected operator[]
* in derived classes
* - 31/12/2002 V1.6 (thof)
* - removed constructor from Theadstruct
* - made the non-initializing constructor
* protected. Default constructor remains public (it
* is needed if we construct a container for
* ConstSharedHeap elements).
*
* ============================================================================
*/
......@@ -39,9 +45,9 @@
#ifndef AFF_SHAREDHEAP_H_VERSION
#define AFF_SHAREDHEAP_H_VERSION \
"AFF_SHAREDHEAP_H V1.5"
"AFF_SHAREDHEAP_H V1.6"
#define AFF_SHAREDHEAP_H_CVSID \
"$Id: sharedheap.h,v 1.14 2002-12-29 23:02:16 forbrig Exp $"
"$Id: sharedheap.h,v 1.15 2002-12-31 17:19:47 forbrig Exp $"
#include<new>
#include<aff/lib/error.h>
......@@ -135,18 +141,12 @@ namespace util {
//! Create from nothing.
ConstSharedHeap();
//! Allocate new heap memory.
ConstSharedHeap(const Tsize& size);
//! Create representation for externally managed memory
ConstSharedHeap(T* pointer, const Tsize& size);
//! Copy representation to share heap.
ConstSharedHeap(const Tcontainer& sharedheap);
//! Copy representation to share heap.
ConstSharedHeap(Theapstruct* heapstruct);
//! Deallocate heap memory if this is the last referencing instance.
~ConstSharedHeap();
......@@ -178,9 +178,17 @@ namespace util {
}
/*-----------------------------------------------------------------*/
// here starts the PROTECTED section!
// ----------------------------------
/* here starts the PROTECTED section!
* ----------------------------------
*
* These functions are needed by the derived aff::SharedHeap class to
* access its base class and the data elements contained therein in a
* defined way.
*/
protected:
//! Allocate new heap memory.
ConstSharedHeap(const Tsize& size);
//! write access to data
inline
T& write_access(const Tsubscript& i)
......
......@@ -3,7 +3,7 @@
*
* ----------------------------------------------------------------------------
*
* $Id: sharedheap_def.h,v 1.11 2002-12-31 15:56:45 forbrig Exp $
* $Id: sharedheap_def.h,v 1.12 2002-12-31 17:19:47 forbrig Exp $
* \author Thomas Forbriger
* \since 08/12/2002
*
......@@ -24,6 +24,7 @@
* independent class template
* - 31/12/2002 V1.3 (thof)
* - NULL is deprecated as pointed out by Wolfgang
* - removed constructor from Theadstruct
*
* ============================================================================
*/
......@@ -38,7 +39,7 @@
#define AFF_SHAREDHEAP_DEF_H_VERSION \
"AFF_SHAREDHEAP_DEF_H V1.3"
#define AFF_SHAREDHEAP_DEF_H_CVSID \
"$Id: sharedheap_def.h,v 1.11 2002-12-31 15:56:45 forbrig Exp $"
"$Id: sharedheap_def.h,v 1.12 2002-12-31 17:19:47 forbrig Exp $"
namespace aff {
......@@ -121,15 +122,6 @@ namespace util {
/*----------------------------------------------------------------------*/
//! create representation from counted reference
template <typename T>
inline
ConstSharedHeap<T>::ConstSharedHeap(Theapstruct* heapstruct)
: Mheapstruct(heapstruct)
{ ++(Mheapstruct->Mnref); }
/*----------------------------------------------------------------------*/
//! create representation from another representation
template <typename T>
inline
......
......@@ -3,7 +3,7 @@
*
* ----------------------------------------------------------------------------
*
* $Id: series.h,v 1.9 2002-12-29 23:02:16 forbrig Exp $
* $Id: series.h,v 1.10 2002-12-31 17:19:47 forbrig Exp $
* \author Thomas Forbriger
* \date 17/12/2002
*
......@@ -28,6 +28,11 @@
* - use "using" syntax for access declarations
* - reworked to use shared heap member data
* - factored out copyin code
* - 31/12/2002 V1.4 (thof)
* - Removed non-initializing constructors in
* ConstSeries (except default constructor, which is
* needed, when object is a container element) as
* suggested by Wolfgang.
*
* ============================================================================
*/
......@@ -36,9 +41,9 @@
#ifndef AFF_SERIES_H_VERSION
#define AFF_SERIES_H_VERSION \
"AFF_SERIES_H V1.3"
"AFF_SERIES_H V1.4"
#define AFF_SERIES_H_CVSID \
"$Id: series.h,v 1.9 2002-12-29 23:02:16 forbrig Exp $"
"$Id: series.h,v 1.10 2002-12-31 17:19:47 forbrig Exp $"
#include <aff/lib/sharedheap.h>
#include <aff/lib/seriesstepper.h>
......@@ -130,6 +135,19 @@ namespace aff {
/*-----------------------------------------------------------------*/
/*! \name Constructors
*
* In the shape&representation constructor the argument order is taken
* to be the same as in array. So the rpresentation is the second
* argument. In all other constructors (except the default) the
* representation is first to allow default arguments for the rest.
*
* \warning
* Constructors maybe subject to changes. The third and the fourth are
* indistinguishable from their argument list due to default
* arguments.
*
* \todo
* resolve resolution conflicts for constructor selection
*
* \note
* We use the default copy constructor, which automatically invokes
......@@ -153,15 +171,11 @@ namespace aff {
Tshape(first,representation.size()+first-1,first),
Mrepresentation(representation) { }
//! construct from shape definition and representation
ConstSeries(const Trepresentation& representation,
const Tsize& size, const Tsize& shift=0,
const Tsubscript& first=1):
ConstSeries(const Trepresentation& representation,
const Tsize& size, const Tsize& shift=0,
const Tsubscript& first=1):
Tshape(first, (representation.size()-shift+first-1), first-shift),
Mrepresentation(representation) { }
//! construct from index range limit
explicit ConstSeries(const Tsize& size, const Tsubscript& first=1):
Tshape(first, size+first-1, first),
Mrepresentation(size) { }
//@}
/*-----------------------------------------------------------------*/
......@@ -276,6 +290,19 @@ namespace aff {
/*-----------------------------------------------------------------*/
/*! \name Constructors
*
* In the shape&representation constructor the argument order is taken
* to be the same as in array. So the rpresentation is the second
* argument. In all other constructors (except the default) the
* representation is first to allow default arguments for the rest.
*
* \warning
* Constructors maybe subject to changes. The third and the fourth are
* indistinguishable from their argument list due to default
* arguments.
*
* \todo
* resolve resolution conflicts for constructor selection
*
* \note
* We use the default copy constructor, which automatically invokes
......
......@@ -3,7 +3,7 @@
*
* ----------------------------------------------------------------------------
*
* $Id: reprtest.cc,v 1.8 2002-12-29 00:09:07 forbrig Exp $
* $Id: reprtest.cc,v 1.9 2002-12-31 17:19:47 forbrig Exp $
* \author Thomas Forbriger
* \date 10/05/2002
*
......@@ -20,13 +20,16 @@
* - compiles and works
* - 28/12/2002 V1.2 (thof)
* - new term for containers of const elements
* - 31/12/2002 V1.3 (thof)
* - initializing an aff::ConstSharedHeap to a defined
* size is a useless exercise
*
* ============================================================================
*/
#define AFF_REPRTEST_CC_VERSION \
"AFF_REPRTEST_CC V1.2"
"AFF_REPRTEST_CC V1.3"
#define AFF_REPRTEST_CC_CVSID \
"$Id: reprtest.cc,v 1.8 2002-12-29 00:09:07 forbrig Exp $"
"$Id: reprtest.cc,v 1.9 2002-12-31 17:19:47 forbrig Exp $"
#include <aff/lib/sharedheap.h>
#include <aff/dump.h>
......@@ -74,7 +77,11 @@ int main()
section("instantiate arrays");
CODE( aff::SharedHeap<int> A(N); )
CODE( aff::SharedHeap<int> B(N2); )
CODE( aff::ConstSharedHeap<int> C(N2); )
#ifdef SENSELESS
#warning intentionally compiling senseless code
CODE( aff::ConstSharedHeap<int> Cuseless(N2); )
#endif
CODE( aff::ConstSharedHeap<int> C; )
CODE( aff::SharedHeap<float> D(N2); )
section("create a const reference to D");
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment