Commit 3e175647 authored by thomas.forbriger's avatar thomas.forbriger Committed by thomas.forbriger
Browse files

start work on interface to raw memory arrays

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/branches/libfourier
SVN Revision: 3939
SVN UUID:     67feda4a-a26e-11df-9d6e-31afc202ad0c
parent 652f848c
/*! \file Carray.cc
* \brief classes to interface raw C arrays (implementation)
*
* ----------------------------------------------------------------------------
*
* $Id$
* \author Thomas Forbriger
* \date 14/05/2011
*
* classes to interface raw C arrays (implementation)
*
* Copyright (c) 2011 by Thomas Forbriger (BFO Schiltach)
*
* ----
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
* ----
*
*
* REVISIONS and CHANGES
* - 14/05/2011 V1.0 Thomas Forbriger
*
* ============================================================================
*/
#define AFF_CARRAY_CC_VERSION \
"AFF_CARRAY_CC V1.0 "
#define AFF_CARRAY_CC_CVSID \
"$Id$"
#include <aff/Carray.h>
namespace aff {
} // namespace aff
/* ----- END OF Carray.cc ----- */
/*! \file Carray.h
* \brief classes to interface raw C arrays (prototypes)
*
* ----------------------------------------------------------------------------
*
* $Id$
* \author Thomas Forbriger
* \date 14/05/2011
*
* classes to interface raw C arrays (prototypes)
*
* Copyright (c) 2011 by Thomas Forbriger (BFO Schiltach)
*
* ----
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
* ----
*
*
* REVISIONS and CHANGES
* - 14/05/2011 V1.0 Thomas Forbriger
*
* ============================================================================
*/
// include guard
#ifndef AFF_CARRAY_H_VERSION
#define AFF_CARRAY_H_VERSION \
"AFF_CARRAY_H V1.0 "
#define AFF_CARRAY_H_CVSID \
"$Id$"
namespace aff {
} // namespace aff
#endif // AFF_CARRAY_H_VERSION (includeguard)
/* ----- END OF Carray.h ----- */
......@@ -101,7 +101,7 @@ HEADERS=$(shell find . -name \*.h)
# (see below for the configuration of a preinstantiated version of template
# code)
SRC=lib/error.cc dump.cc lib/strided.cc lib/stridedstepper.cc \
lib/seriesstepper.cc fortranshape.cc
lib/seriesstepper.cc fortranshape.cc Carray.cc
# test programs are placed in a subdirectory
TESTS=$(wildcard tests/*.cc)
# whereever we find a README, we will use it
......
......@@ -50,6 +50,8 @@
* - 10/11/2010 V1.6 (thof)
* - code fragments for precompiled templates are
* removed from the library (\ref sec_design_binary)
* - 14/05/2011 V1.7 (thof)
* - add info on raw-major and column-major order
*
* ============================================================================
*/
......@@ -83,6 +85,7 @@ $Id$
- \ref sec_main_peculiar
Additional information:
- \ref page_array_layout
- \ref page_design
- \ref page_using
- \ref page_notes
......@@ -930,4 +933,23 @@ We need more text and examples.
*/
/*======================================================================*/
/*! \page page_array_layout Array layout
The array class template aff::Array uses the shape class aff::Strided.
Usually and in particular when constructed by using aff::Shaper,
aff::Strided uses a Fortran like column-major layout in memory.
aff::FortranArray and aff::util::FortranShape are provided to interface
Fortran code with such kind of arrays.
Nevertheless aff::Array together with aff::Strided is able to address a
row-major C like memory layout too.
Classes to interface raw memory arrays are presented in Carray.h.
\section sec_array_layout_row_major Row major layout
\section sec_array_layout_column_major Column major layout
*/
// ----- END OF README -----
......@@ -27,6 +27,10 @@
Major changes in the interface of the library are marked by \b !!.
- 14/05/2011 (thof)
- added Carray.h and Carray.cc to provide interfaces to arrays in raw
memory.
- 10/11/2010 (thof)
- removed code fragments for precompiled templates
- joined array_dec.h and array_def.h in array.h
......@@ -285,6 +289,12 @@
<TR><TD>libaff/arrayoperators.h</TD>
<TD>10/02/2004</TD><TD> </TD><TD>10/02/2004 </TD><TD> </TD>
</TR>
<TR><TD>libaff/Carray.h</TD>
<TD> </TD><TD> </TD><TD> </TD><TD> </TD>
</TR>
<TR><TD>libaff/Carray.cc</TD>
<TD> </TD><TD> </TD><TD> </TD><TD> </TD>
</TR>
<TR><TD>libaff/dump.cc</TD>
<TD>18/12/2002</TD><TD>20/12/2002</TD><TD>18/12/2002</TD><TD> </TD>
</TR>
......
......@@ -87,6 +87,8 @@ namespace aff {
* arrays. This is in contrast to packed layouts for banded matrices or
* triangular matrices that do not hold every array element.
*
* A Strided shape typically is constrcuted through an aff::Shaper class.
*
* \note
* dimension index is 0,1,2,... (zero-based) when calling size(i) member
* function e.g.
......@@ -145,12 +147,16 @@ namespace aff {
explicit Strided(const TSizeVec& sizes, const Tsubscript& first=1,
const Tsubscript& shift=0)
{ setup_from_size(sizes, first, shift); }
/*! \brief construct do given first and last index
/*! \brief construct Fortran layout to given first and last index
*
* \param first vector of first index value in each dimension
* \param last vector of last index value in each dimension
* \param shift defines offset shift (i.e. first element accessed in
* memory representation)
*
* This constructor together with the aff::Strided::shrink() function is
* used by aff::Shaper in aff::Shaper::operator Tshape () to create a
* strided shape.
*/
explicit Strided(const TIndexVec& first, const TIndexVec& last,
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