1
0
mirror of https://github.com/aportelli/LatAnalyze.git synced 2024-11-10 00:45:36 +00:00

Merge branch 'master' into new_fit

# Conflicts:
#	lib/Plot.hpp
This commit is contained in:
Antonin Portelli 2016-04-06 18:40:14 +01:00
commit ebc676e577
3 changed files with 57 additions and 1 deletions

View File

@ -149,7 +149,7 @@ public:
#define PlotMatrix(m)\
PlotRange(Axis::x, -.5, (m).cols() - .5) <<\
PlotRange(Axis::y, -.5, (m).rows() - .5) <<\
PlotRange(Axis::y, (m).rows() - .5, -.5) <<\
PlotMatrixNoRange(m)
/******************************************************************************

View File

@ -10,6 +10,7 @@ bin_PROGRAMS = \
latan_create_rg_state \
latan_make_fake_sample\
latan_sample_combine \
latan_sample_plot_corr\
latan_sample_read \
latan_resample
@ -25,6 +26,10 @@ latan_sample_combine_SOURCES = sample_combine.cpp
latan_sample_combine_CXXFLAGS = $(COM_CXXFLAGS)
latan_sample_combine_LDFLAGS = -L../lib/.libs -lLatAnalyze
latan_sample_plot_corr_SOURCES = sample_plot_corr.cpp
latan_sample_plot_corr_CXXFLAGS = $(COM_CXXFLAGS)
latan_sample_plot_corr_LDFLAGS = -L../lib/.libs -lLatAnalyze
latan_sample_read_SOURCES = sample_read.cpp
latan_sample_read_CXXFLAGS = $(COM_CXXFLAGS)
latan_sample_read_LDFLAGS = -L../lib/.libs -lLatAnalyze

View File

@ -0,0 +1,51 @@
/*
* sample_plot_corr.cpp, part of LatAnalyze 3
*
* Copyright (C) 2013 - 2016 Antonin Portelli
*
* LatAnalyze 3 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 3 of the License, or
* (at your option) any later version.
*
* LatAnalyze 3 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 LatAnalyze 3. If not, see <http://www.gnu.org/licenses/>.
*/
#include <iostream>
#include <LatAnalyze/Io.hpp>
#include <LatAnalyze/Math.hpp>
#include <LatAnalyze/Plot.hpp>
using namespace std;
using namespace Latan;
using namespace Math;
int main(int argc, char *argv[])
{
if (argc != 2)
{
cerr << "usage: " << argv[0] << " <file>" << endl;
return EXIT_FAILURE;
}
string fileName = argv[1], name;
DMatSample sample;
DMat var;
Plot p;
cout << "-- computing variance matrix from '" << fileName << "'..." << endl;
name = Io::getFirstName(fileName);
sample = Io::load<DMatSample>(fileName);
var = sample.varianceMatrix();
p << PlotMatrix(varToCorr(var));
p.display();
return EXIT_SUCCESS;
}