Skip to content

Instantly share code, notes, and snippets.

View lambday's full-sized avatar

Soumyajit De lambday

  • Meta
  • London
  • 09:55 (UTC)
View GitHub Profile
./features/DenseSubsetFeatures.h: In member function ‘float64_t shogun::CDenseSubsetFeatures<ST>::dot(int32_t, shogun::CDotFeatures*, int32_t) [with ST = std::complex<double>, float64_t = double, int32_t = int, shogun::CDotFeatures = shogun::CDotFeatures]’:
base/class_list.cpp:1609:1: instantiated from here
./features/DenseSubsetFeatures.h:132:4: error: no match for ‘operator+=’ in ‘sum += std::operator* [with _Tp = double]((*(const std::complex<double>*)vec1.shogun::SGVector<T>::operator[] [with T = std::complex<double>, index_t = int](((shogun::CDenseSubsetFeatures<std::complex<double> >*)this)->shogun::CDenseSubsetFeatures<std::complex<double> >::m_idx.shogun::SGVector<T>::operator[] [with T = int, index_t = int](i))), (*(const std::complex<double>*)vec2.shogun::SGVector<T>::operator[] [with T = std::complex<double>, index_t = int](dsf->shogun::CDenseSubsetFeatures<std::complex<double> >::m_idx.shogun::SGVector<T>::operator[] [with T = int, index_t = int](i))))’
base/SGObject_unittest.cc: In member function ‘virtual void SGObject_equals_same_Test::TestBody()’:
base/SGObject_unittest.cc:29:2: error: ‘CGaussianKernel’ was not declared in this scope
base/SGObject_unittest.cc:29:19: error: ‘kernel’ was not declared in this scope
base/SGObject_unittest.cc:29:30: error: expected type-specifier before ‘CGaussianKernel’
base/SGObject_unittest.cc:29:30: error: expected ‘;’ before ‘CGaussianKernel’
base/SGObject_unittest.cc: In member function ‘virtual void SGObject_equals_NULL_parameter_Test::TestBody()’:
base/SGObject_unittest.cc:40:2: error: ‘CDenseFeatures’ was not declared in this scope
base/SGObject_unittest.cc:40:26: error: expected primary-expression before ‘>’ token
base/SGObject_unittest.cc:40:29: error: ‘feats’ was not declared in this scope
base/SGObject_unittest.cc:40:39: error: expected type-specifier before ‘CDenseFeatures’
TEST(Serialization, Ascii_scaler_equal_FLOAT64)
{
float64_t a=1.7126587125;
TSGDataType type(CT_SCALAR, ST_NONE, PT_FLOAT64);
TParameter* param1=new TParameter(&type, &a, "", "");
TParameter* param2=new TParameter(&type, NULL, "", "");
const char* filename="float64_param.txt";
// save parameter to an ascii file
TEST(Serialization, Ascii_scaler_equal_FLOAT64)
{
float64_t a=1.7126587125;
TSGDataType type(CT_SCALAR, ST_NONE, PT_FLOAT64);
TParameter* param1=new TParameter(&type, &a, "param1", "");
TParameter* param2=new TParameter(&type, NULL, "param2", "");
const char* filename="float64_param.txt";
// save parameter to an ascii file
TEST(Serialization, Json_scaler_equal_FLOAT64)
{
float64_t a=1.7126587125;
float64_t b=0.0;
TSGDataType type(CT_SCALAR, ST_NONE, PT_FLOAT64);
TParameter* param1=new TParameter(&type, &a, "param", "");
TParameter* param2=new TParameter(&type, &b, "param", "");
const char* filename="float64_param.json";
/*
* 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 3 of the License, or
* (at your option) any later version.
*
* Written (W) 2013 Heiko Strathmann
*/
#include <shogun/lib/config.h>
#include <iostream>
#include <cmath>
#include <Eigen/Dense>
using namespace std;
using namespace Eigen;
int main()
{
Matrix2f A;
function_that_estimates_logdet
{
CSparseMatrixOperator<float64_t> *op
CSerialComputationEngine *e
CLogRationalApproximationCOCGM log_op(op, e)
// or CLogRationalApproximationIndividual log_op(op, e)
CProbingSampler *sampler
CLogDetEstimator est(log_op, e, sampler)
SGVector<float64_t> samples=est.sample(num_logdet_estimates)
}
/*
* 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 3 of the License, or
* (at your option) any later version.
*
* Written (W) 2013 Soumyajit De
*/
#include <shogun/lib/common.h>
CRationalApproximationIndividual::submit_jobs()
{
CDenseMatrixOperator<complex64_t> orig_operator();
SGVector<complex64_t> orig_diag=orig_operator.get_diagonal();
// copy all the elements from m_linear_operator to orig_operator with typecast
CIndividualJobResultAggregator agg;
for all shifts sh
{
// creates a deep copy of the matrix using SGMatrix<T>::clone()
CDenseMatrixOperator<complex64_t> operator(orig_operator);