Commit 874390a5 authored by thomas.forbriger's avatar thomas.forbriger Committed by thomas.forbriger
Browse files

added connectors for series class

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: 3948
SVN UUID:     67feda4a-a26e-11df-9d6e-31afc202ad0c
parent 6b00acc5
......@@ -94,6 +94,26 @@
Place ingroup definitions in source code
*/
/*----------------------------------------------------------------------*/
/*! \brief Series container
\defgroup group_series Series container
\sa \ref group_series_extensions
\todo
Place ingroup definitions in source code
*/
/*----------------------------------------------------------------------*/
/*! \brief Extensions for series module
\defgroup group_series_extensions Extensions for series module
\todo
Place ingroup definitions in source code
*/
/*======================================================================*/
// ----- END OF README.groups -----
/*! \file seriesconnectors.h
* \brief some helpers to connect to a series container from other representations (prototypes)
*
* ----------------------------------------------------------------------------
*
* $Id$
* \author Thomas Forbriger
* \date 15/05/2011
*
* some helpers to connect to a series container from other representations (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
* - 15/05/2011 V1.0 Thomas Forbriger
*
* ============================================================================
*/
// include guard
#ifndef AFF_SERIESCONNECTORS_H_VERSION
#define AFF_SERIESCONNECTORS_H_VERSION \
"AFF_SERIESCONNECTORS_H V1.0 "
#define AFF_SERIESCONNECTORS_H_CVSID \
"$Id$"
#include<aff/array.h>
#include<aff/series.h>
#include<aff/error.h>
namespace aff {
namespace util {
/*! \brief
* \param array container to be checked
* \return true if shape is 1D and contents are dense in memory
*/
template<class T>
bool is_dense_1D_array(const aff::ConstArray<T>& array)
{
AFF_abort("not yet implemented");
} // bool is_dense_1D_array(const aff::ConstArray<T>& array)
} // namespace util
/*----------------------------------------------------------------------*/
/*! \brief create a series container from an array container.
*
* \ingroup group_series_extensions group_array_extensions
*/
template<class T>
aff::Series<T> series_from_array(const aff::Array<T>& array)
{
AFF_assert(is_dense_1D_array(array),
"ERROR: array is not suitable to be converted to series");
} // aff::Series<T> series_from_array(const aff::Array<T>& array)
/*----------------------------------------------------------------------*/
/*! \brief create a series container from an array container.
*
* \ingroup group_series_extensions group_array_extensions
*/
template<class T>
aff::ConstSeries<T> series_from_array(const aff::ConstArray<T>& array)
{
AFF_assert(is_dense_1D_array(array),
"ERROR: array is not suitable to be converted to series");
} // aff::Series<T> series_from_array(const aff::Array<T>& array)
/*----------------------------------------------------------------------*/
/*! \brief create an array container from a series container.
*
* \ingroup group_series_extensions group_array_extensions
*/
template<class T>
aff::Array<T> array_from_series(const aff::Series<T>& array)
{
AFF_abort("not yet implemented");
} // aff::Series<T> series_from_array(const aff::Array<T>& array)
/*----------------------------------------------------------------------*/
/*! \brief create an array container from a series container.
*
* \ingroup group_series_extensions group_array_extensions
*/
template<class T>
aff::ConstArray<T> array_from_series(const aff::ConstSeries<T>& array)
{
AFF_abort("not yet implemented");
} // aff::Series<T> series_from_array(const aff::Array<T>& array)
/*----------------------------------------------------------------------*/
/*! \brief create a series class from raw memory.
*
* \ingroup group_series_extensions
*
* \param pointer pointer to first element in raw memory
* \param size number of elements allocated in raw memory
* \return series container accessing raw memory
*/
template<class T>
aff::Series<T> series_from_raw_memory(T* pointer,
const unsigned int size)
{
typedef aff::Series<T> Tseries;
typename Tseries::Tshape shape(0, size-1, 0);
typename Tseries::Trepresentation representation(pointer, size);
Tseries retval(shape, representation);
return(retval);
} // aff::Series<T> series_from_raw_memory
} // namespace aff
#endif // AFF_SERIESCONNECTORS_H_VERSION (includeguard)
/* ----- END OF seriesconnectors.h ----- */
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