Commit 0eec6821 authored by thomas.forbriger's avatar thomas.forbriger Committed by thomas.forbriger
Browse files

use subarray together with Series

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: 1452
SVN UUID:     67feda4a-a26e-11df-9d6e-31afc202ad0c
parent bad69b46
......@@ -3,7 +3,7 @@
*
* ----------------------------------------------------------------------------
*
* $Id: README.changelog,v 1.41 2004-01-11 17:25:23 tforb Exp $
* $Id: README.changelog,v 1.42 2004-01-13 19:51:54 tforb Exp $
*
* Copyright (c) 2002 by Thomas Forbriger (IMG Frankfurt)
*
......@@ -21,12 +21,18 @@
/*! \page page_changelog ChangeLog (AFF)
$Id: README.changelog,v 1.41 2004-01-11 17:25:23 tforb Exp $
$Id: README.changelog,v 1.42 2004-01-13 19:51:54 tforb Exp $
\sa \ref page_project_status
Major changes in the interface of the library are marked by \b !!.
- \b 13/01/2004 (thof)
- added shrink function to aff::LinearShape so that aff::subarray is
applicable to aff::Series
- corrected constructor from shape and representation in aff::Series to
initialize base class first
- \b 11/01/2004 (thof)
- added index range modifiers to aff::LinearShape
......@@ -187,7 +193,7 @@
/*! \page page_project_status Project status (AFF)
$Id: README.changelog,v 1.41 2004-01-11 17:25:23 tforb Exp $
$Id: README.changelog,v 1.42 2004-01-13 19:51:54 tforb Exp $
\sa \ref page_changelog
......
......@@ -3,7 +3,7 @@
*
* ----------------------------------------------------------------------------
*
* $Id: linearshape.h,v 1.2 2004-01-11 17:25:23 tforb Exp $
* $Id: linearshape.h,v 1.3 2004-01-13 19:51:55 tforb Exp $
* \author Thomas Forbriger
* \date 23/12/2003
*
......@@ -14,6 +14,10 @@
* REVISIONS and CHANGES
* - 23/12/2003 V1.0 Thomas Forbriger
* - 11/01/2004 V1.1 now offers index range modifiers
* - 13/01/2004 V1.2
* - now provide Mmax_dimen
* - renamed reshaping functions to match the class
* Strided
*
* ============================================================================
*/
......@@ -22,9 +26,9 @@
#ifndef AFF_LINEARSHAPE_H_VERSION
#define AFF_LINEARSHAPE_H_VERSION \
"AFF_LINEARSHAPE_H V1.1 "
"AFF_LINEARSHAPE_H V1.2 "
#define AFF_LINEARSHAPE_H_CVSID \
"$Id: linearshape.h,v 1.2 2004-01-11 17:25:23 tforb Exp $"
"$Id: linearshape.h,v 1.3 2004-01-13 19:51:55 tforb Exp $"
namespace aff {
......@@ -53,6 +57,15 @@ namespace aff {
class LinearShape
{
public:
/*! maximum dimensionality
*
* This is defined to make Subarray useable with the Series class.
*
* \note
* Some parts of the code rely on \c Mmax_dimen>=2. This condition is
* intrinsically violated here.
*/
static const Tdim Mmax_dimen=1;
typedef aff::util::SeriesStepper Tstepper;
LinearShape(): Mfirst(0), Mlast(0), Mbase(0) { }
LinearShape(const Tsubscript& first,
......@@ -71,6 +84,20 @@ namespace aff {
Tsize size() const
{ return(static_cast<Tsize>(Mlast-Mfirst+1)); }
Tsize memory_size() const { return(this->size()); }
LinearShape& shrink(const Tdim& i,
const Tsubscript& first, const Tsubscript& last)
{
AFF_assert((i==0),"ERROR (LinearShape::shrink): illegal dimension!");
this->setindexrange(first, last);
return(*this);
}
LinearShape& shrink(const Tdim& i,
const Tsubscript& last)
{
AFF_assert((i==0),"ERROR (LinearShape::shrink): illegal dimension!");
this->setlastindex(last);
return(*this);
}
void setindexrange(const Tsubscript& first,
const Tsubscript last)
{
......
......@@ -3,7 +3,7 @@
*
* ----------------------------------------------------------------------------
*
* $Id: series.h,v 1.12 2003-12-23 13:53:30 tforb Exp $
* $Id: series.h,v 1.13 2004-01-13 19:51:54 tforb Exp $
* \author Thomas Forbriger
* \date 17/12/2002
*
......@@ -42,6 +42,9 @@
* - typedef Tstepper is not needed, is it?
* - well, it is needed. but you will find LinearShape
* in lib/linearshape.h now - anyway
* - 13/01/2004 V1.7 (thof)
* - corrected error in constructor from shape and
* representation
*
* ============================================================================
*/
......@@ -50,9 +53,9 @@
#ifndef AFF_SERIES_H_VERSION
#define AFF_SERIES_H_VERSION \
"AFF_SERIES_H V1.6"
"AFF_SERIES_H V1.7"
#define AFF_SERIES_H_CVSID \
"$Id: series.h,v 1.12 2003-12-23 13:53:30 tforb Exp $"
"$Id: series.h,v 1.13 2004-01-13 19:51:54 tforb Exp $"
#include <aff/lib/sharedheap.h>
#include <aff/lib/linearshape.h>
......@@ -280,8 +283,8 @@ namespace aff {
//! construct from shape and representation
Series(const Tshape& shape,
const Trepresentation& representation):
Tshape(shape), Mrepresentation(representation)
{ Tbase::operator=(Tbase(shape, Mrepresentation)); }
Tbase(shape, representation), Mrepresentation(representation)
{ }
//! construct from representation
Series(const Trepresentation& representation,
const Tsubscript& shift=0)
......
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