Skip to content

Commit

Permalink
Updated data generation routines in converters examples
Browse files Browse the repository at this point in the history
  • Loading branch information
lisitsyn committed Sep 9, 2012
1 parent 2e41877 commit 89373e4
Show file tree
Hide file tree
Showing 12 changed files with 23 additions and 12 deletions.
3 changes: 2 additions & 1 deletion examples/undocumented/libshogun/converter_diffusionmaps.cpp
Expand Up @@ -11,6 +11,7 @@
#include <shogun/base/init.h>
#include <shogun/features/DenseFeatures.h>
#include <shogun/converter/DiffusionMaps.h>
#include <shogun/mathematics/Math.h>

using namespace shogun;

Expand All @@ -22,7 +23,7 @@ int main(int argc, char** argv)
int dim = 3;
float64_t* matrix = new double[N*dim];
for (int i=0; i<N*dim; i++)
matrix[i] = i;
matrix[i] = CMath::sin((i/float64_t(N*dim))*3.14);

CDenseFeatures<double>* features = new CDenseFeatures<double>(SGMatrix<double>(matrix,dim,N));
SG_REF(features);
Expand Down
Expand Up @@ -11,6 +11,7 @@
#include <shogun/base/init.h>
#include <shogun/features/DenseFeatures.h>
#include <shogun/converter/HessianLocallyLinearEmbedding.h>
#include <shogun/mathematics/Math.h>

using namespace shogun;

Expand All @@ -22,7 +23,7 @@ int main(int argc, char** argv)
int dim = 3;
float64_t* matrix = new double[N*dim];
for (int i=0; i<N*dim; i++)
matrix[i] = i;
matrix[i] = CMath::sin((i/float64_t(N*dim))*3.14);

CDenseFeatures<double>* features = new CDenseFeatures<double>(SGMatrix<double>(matrix,dim,N));
SG_REF(features);
Expand Down
3 changes: 2 additions & 1 deletion examples/undocumented/libshogun/converter_isomap.cpp
Expand Up @@ -11,6 +11,7 @@
#include <shogun/base/init.h>
#include <shogun/features/DenseFeatures.h>
#include <shogun/converter/Isomap.h>
#include <shogun/mathematics/Math.h>

using namespace shogun;

Expand All @@ -22,7 +23,7 @@ int main(int argc, char** argv)
int dim = 3;
float64_t* matrix = new double[N*dim];
for (int i=0; i<N*dim; i++)
matrix[i] = i;
matrix[i] = CMath::sin((i/float64_t(N*dim))*3.14);

CDenseFeatures<double>* features = new CDenseFeatures<double>(SGMatrix<double>(matrix,dim,N));
SG_REF(features);
Expand Down
Expand Up @@ -12,6 +12,7 @@
#include <shogun/features/DenseFeatures.h>
#include <shogun/converter/KernelLocallyLinearEmbedding.h>
#include <shogun/kernel/LinearKernel.h>
#include <shogun/mathematics/Math.h>

using namespace shogun;

Expand All @@ -23,7 +24,7 @@ int main(int argc, char** argv)
int dim = 3;
float64_t* matrix = new double[N*dim];
for (int i=0; i<N*dim; i++)
matrix[i] = i;
matrix[i] = CMath::sin((i/float64_t(N*dim))*3.14);

CDenseFeatures<double>* features = new CDenseFeatures<double>(SGMatrix<double>(matrix,dim,N));
SG_REF(features);
Expand Down
Expand Up @@ -12,6 +12,7 @@
#include <shogun/features/DenseFeatures.h>
#include <shogun/converter/KernelLocalTangentSpaceAlignment.h>
#include <shogun/kernel/LinearKernel.h>
#include <shogun/mathematics/Math.h>

using namespace shogun;

Expand All @@ -23,7 +24,7 @@ int main(int argc, char** argv)
int dim = 3;
float64_t* matrix = new double[N*dim];
for (int i=0; i<N*dim; i++)
matrix[i] = i;
matrix[i] = CMath::sin((i/float64_t(N*dim))*3.14);

CDenseFeatures<double>* features = new CDenseFeatures<double>(SGMatrix<double>(matrix,dim,N));
SG_REF(features);
Expand Down
Expand Up @@ -11,6 +11,7 @@
#include <shogun/base/init.h>
#include <shogun/features/DenseFeatures.h>
#include <shogun/converter/LaplacianEigenmaps.h>
#include <shogun/mathematics/Math.h>

using namespace shogun;

Expand All @@ -22,7 +23,7 @@ int main(int argc, char** argv)
int dim = 3;
float64_t* matrix = new double[N*dim];
for (int i=0; i<N*dim; i++)
matrix[i] = i;
matrix[i] = CMath::sin((i/float64_t(N*dim))*3.14);

CDenseFeatures<double>* features = new CDenseFeatures<double>(SGMatrix<double>(matrix,dim,N));
SG_REF(features);
Expand Down
Expand Up @@ -11,6 +11,7 @@
#include <shogun/base/init.h>
#include <shogun/features/DenseFeatures.h>
#include <shogun/converter/LinearLocalTangentSpaceAlignment.h>
#include <shogun/mathematics/Math.h>

using namespace shogun;

Expand All @@ -22,7 +23,7 @@ int main(int argc, char** argv)
int dim = 3;
float64_t* matrix = new double[N*dim];
for (int i=0; i<N*dim; i++)
matrix[i] = i;
matrix[i] = CMath::sin((i/float64_t(N*dim))*3.14);

CDenseFeatures<double>* features = new CDenseFeatures<double>(SGMatrix<double>(matrix,dim,N));
SG_REF(features);
Expand Down
Expand Up @@ -11,6 +11,7 @@
#include <shogun/base/init.h>
#include <shogun/features/DenseFeatures.h>
#include <shogun/converter/LocallyLinearEmbedding.h>
#include <shogun/mathematics/Math.h>

using namespace shogun;

Expand All @@ -22,7 +23,7 @@ int main(int argc, char** argv)
int dim = 3;
float64_t* matrix = new double[N*dim];
for (int i=0; i<N*dim; i++)
matrix[i] = i;
matrix[i] = CMath::sin((i/float64_t(N*dim))*3.14);

CDenseFeatures<double>* features = new CDenseFeatures<double>(SGMatrix<double>(matrix,dim,N));
SG_REF(features);
Expand Down
Expand Up @@ -11,6 +11,7 @@
#include <shogun/base/init.h>
#include <shogun/features/DenseFeatures.h>
#include <shogun/converter/LocalTangentSpaceAlignment.h>
#include <shogun/mathematics/Math.h>

using namespace shogun;

Expand All @@ -22,7 +23,7 @@ int main(int argc, char** argv)
int dim = 3;
float64_t* matrix = new double[N*dim];
for (int i=0; i<N*dim; i++)
matrix[i] = i;
matrix[i] = CMath::sin((i/float64_t(N*dim))*3.14);

CDenseFeatures<double>* features = new CDenseFeatures<double>(SGMatrix<double>(matrix,dim,N));
SG_REF(features);
Expand Down
Expand Up @@ -11,6 +11,7 @@
#include <shogun/base/init.h>
#include <shogun/features/DenseFeatures.h>
#include <shogun/converter/MultidimensionalScaling.h>
#include <shogun/mathematics/Math.h>

using namespace shogun;

Expand All @@ -22,7 +23,7 @@ int main(int argc, char** argv)
int dim = 3;
float64_t* matrix = new double[N*dim];
for (int i=0; i<N*dim; i++)
matrix[i] = i;
matrix[i] = CMath::sin((i/float64_t(N*dim))*3.14);

CDenseFeatures<double>* features = new CDenseFeatures<double>(SGMatrix<double>(matrix,dim,N));
SG_REF(features);
Expand Down
Expand Up @@ -23,7 +23,7 @@ int main(int argc, char** argv)
int dim = 3;
float64_t* matrix = new double[N*dim];
for (int i=0; i<N*dim; i++)
matrix[i] = CMath::random(1,100);
matrix[i] = CMath::sin((i/float64_t(N*dim))*3.14);

CDenseFeatures<double>* features = new CDenseFeatures<double>(SGMatrix<double>(matrix,dim,N));
SG_REF(features);
Expand Down
Expand Up @@ -11,6 +11,7 @@
#include <shogun/base/init.h>
#include <shogun/features/DenseFeatures.h>
#include <shogun/converter/StochasticProximityEmbedding.h>
#include <shogun/mathematics/Math.h>

using namespace shogun;

Expand All @@ -24,7 +25,7 @@ int main()
// Generate toy data
SGMatrix< float64_t > matrix(dim, N);
for (int i=0; i<N*dim; i++)
matrix[i] = i;
matrix[i] = CMath::sin((i/float64_t(N*dim))*3.14);

CDenseFeatures< float64_t >* features = new CDenseFeatures<float64_t>(matrix);
SG_REF(features);
Expand Down

0 comments on commit 89373e4

Please sign in to comment.