Commit 99ad57c8 authored by thomas.forbriger's avatar thomas.forbriger
Browse files

croposp [WP]: start to introduce triples

parent 61188689
......@@ -136,6 +136,7 @@ LIBTSIOXX=-ltsioxx -ltsxx -ltfxx $(LIBDATRWXX) -lgsl -lgslcblas
OBJFILES=pairs_adapter.o \
pairs.o \
triples.o \
patsubst.o \
report_collection.o \
write_name_series.o
......
......@@ -96,11 +96,31 @@ namespace croposp {
const unsigned int& l) const;
unsigned int size() const;
unsigned int pairs() const;
unsigned int triples() const;
private:
unsigned int Mn;
}; // class Pairs
/* ---------------------------------------------------------------------- */
/*! provide index values to triples
*
* cycle through a complete set
*/
class Triples {
public:
Triples(const Pairs& p, const bool& pairs_first=false);
unsigned int operator()(const unsigned int& k,
const unsigned int& l) const;
bool swap(const unsigned int& k,
const unsigned int& l) const;
unsigned int size() const;
unsigned int pairs() const;
unsigned int triples() const;
private:
Pairs Mpairs;
bool Mpairs_first;
}; // class Triples
/* ====================================================================== */
/* functions
* ---------
......
/*! \file triples.cc
* \brief Handle index values for triples of time series (implementation)
*
* ----------------------------------------------------------------------------
*
* \author Thomas Forbriger
* \date 08/02/2019
*
* Handle index values for triples of time series (implementation)
*
* Copyright (c) 2019 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, see <http://www.gnu.org/licenses/>.
* ----
*
* REVISIONS and CHANGES
* - 08/02/2019 V1.0 Thomas Forbriger
*
* ============================================================================
*/
#define TF_TRIPLES_CC_VERSION \
"TF_TRIPLES_CC V1.0"
#include "croposp.h"
#include<tfxx/error.h>
/*! \class croposp::Triples
*
* Handle triples of signals.
*
* The constructor takes the Pairs to be handled in the triples
* Index values must be positive (zero or larger than zero) and smaller than
* the size of the collection.
*/
namespace croposp {
Triples::Triples(const Pairs& p, const bool& pairs_first=false):
Mpairs(p), Mpairs_first(pairs_first)
{
TFXX_assert(this->size()>2,
"collection must have at least three elements to make a triple");
}
/* ---------------------------------------------------------------------- */
} // namespace croposp
/* ----- END OF triples.cc ----- */
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