Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Seitosh
Seitosh
Commits
61188689
Commit
61188689
authored
Feb 07, 2019
by
thomas.forbriger
Browse files
croposp [WP]: start coding first triple function
parent
fc2d5da7
Changes
4
Hide whitespace changes
Inline
Side-by-side
src/ts/croposp/Makefile
View file @
61188689
...
...
@@ -138,7 +138,6 @@ OBJFILES=pairs_adapter.o \
pairs.o
\
patsubst.o
\
report_collection.o
\
triples.o
\
write_name_series.o
croposptest croposp
:
\
...
...
src/ts/croposp/croposp.cc
View file @
61188689
...
...
@@ -628,6 +628,36 @@ int main(int iargc, char* argv[])
}
// if (opt.compute_coherency)
/* ---------------------------------------------------------------------- */
/* compute amplitude transfer function
* -----------------------------------
*/
if
(
opt
.
compute_transfer
)
{
if
(
opt
.
verbose
)
{
cout
<<
endl
<<
"Compute amplitude transfer function for all pairs of signals."
<<
endl
;
}
TFXX_assert
(
pairs
.
size
()
>
2
,
"requires at least three input time series"
);
croposp
::
TNamedSeriesVector
transfer_vector
(
pairs
.
triples
());
TFXX_assert
(
PSD_vector
.
size
()
==
pairs
.
size
(),
"inconsistency; report this as a bug"
);
TFXX_assert
(
CPSD_vector
.
size
()
==
pairs
.
pairs
(),
"inconsistency; report this as a bug"
);
/* ======================================================================
* NOTICE: the direct access to a linear vector of triples requires its
* own indexing scheme; this cannot be accomplished by means of class
* Pairs.
* */
}
// if (opt.compute_coherency)
}
// main()
/* ----- END OF croposp.cc ----- */
src/ts/croposp/croposp.h
View file @
61188689
...
...
@@ -96,21 +96,11 @@ 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
unsigned
int
&
n
);
};
// class Triples
/* ====================================================================== */
/* functions
* ---------
...
...
src/ts/croposp/pairs.cc
View file @
61188689
...
...
@@ -96,10 +96,20 @@ namespace croposp {
unsigned
int
Pairs
::
pairs
()
const
{
TFXX_assert
(
this
->
size
()
>
1
,
"size is too small to build pairs"
);
unsigned
int
retval
=
(
this
->
Mn
*
(
this
->
Mn
-
1
))
/
2
;
return
(
retval
);
}
// unsigned int Pairs::size() const
/* ---------------------------------------------------------------------- */
unsigned
int
Pairs
::
triples
()
const
{
TFXX_assert
(
this
->
size
()
>
2
,
"size is too small to build triples"
);
unsigned
int
retval
=
(
this
->
Mn
*
(
this
->
Mn
-
1
)
*
(
this
->
Mn
-
2
))
/
2
;
return
(
retval
);
}
// unsigned int Pairs::triples() const
}
// namespace croposp
/* ----- END OF pairs.cc ----- */
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment