Commit 5fb734a8 authored by Ken Martin's avatar Ken Martin

speed up the slowest tests

These tests were taking way too long on some or all
test platforms. In some cases more than two minutes
to run.
parent fb0fd75f
......@@ -76,7 +76,7 @@ int MomentCheck(double min, double max, std::size_t nValues)
std::cout<<"Skewness: "<<empiricalSkewness<<" "<<analyticSkewness<<std::endl;
std::cout<<"Kurtosis: "<<empiricalKurtosis<<" "<<analyticKurtosis<<std::endl;
#define EPSILON 1.e-3
#define EPSILON 2.e-3
if (fabs(empiricalMean - analyticMean) > EPSILON)
{
......@@ -231,7 +231,7 @@ int ConsistencyCheck()
int TestMersenneTwister(int,char *[])
{
if (MomentCheck(0.,1.,1.e7) != VTK_SUCCESS)
if (MomentCheck(0.,1.,1.e6) != VTK_SUCCESS)
{
return VTK_FAILURE;
}
......
......@@ -34,8 +34,8 @@
#include <sstream>
#include <locale> // C++ locale
#define ARRAY_SIZE (2*1024*1024)
// #define ARRAY_SIZE 128
//#define ARRAY_SIZE (2*1024*1024)
#define ARRAY_SIZE 2048
int TestSortDataArray(int, char *[])
{
......
......@@ -25,7 +25,7 @@
int TimePointLocators(int , char *[])
{
int nPts = 1000000;
int nPts = 100000;
int nQ = nPts/10;
int N = 10;
double R = 0.01;
......
12a064ed364796bf1b871e76c0ec05f3
6030f3d8d0949dc04dea93a51ebca7d4
29f9aac6f51eb73f765e51bc9dd94a18
7a194dcb3a9a68787fda962a7d3bd7f9
......@@ -5,7 +5,7 @@ from vtk.util.misc import vtkGetDataRoot
VTK_DATA_ROOT = vtkGetDataRoot()
# Parameters for debugging
res = 1000
res = 200
# create pipeline
#
......@@ -186,6 +186,7 @@ ren2.SetViewport(0,0.5,.5,1)
ren3 = vtk.vtkRenderer()
ren3.SetViewport(0.5,0.5,1,1)
renWin = vtk.vtkRenderWindow()
renWin.SetMultiSamples(0)
renWin.AddRenderer(ren0)
renWin.AddRenderer(ren1)
renWin.AddRenderer(ren2)
......
......@@ -7,7 +7,7 @@ VTK_DATA_ROOT = vtkGetDataRoot()
# Interpolate onto a volume
# Parameters for debugging
res = 100
res = 40
# create pipeline
#
......@@ -79,6 +79,7 @@ outlineActor.SetMapper(outlineMapper)
#
ren0 = vtk.vtkRenderer()
renWin = vtk.vtkRenderWindow()
renWin.SetMultiSamples(0)
renWin.AddRenderer(ren0)
iren = vtk.vtkRenderWindowInteractor()
iren.SetRenderWindow(renWin)
......
......@@ -5,7 +5,7 @@ from vtk.util.misc import vtkGetDataRoot
VTK_DATA_ROOT = vtkGetDataRoot()
# Parameters for debugging
res = 500
res = 200
math = vtk.vtkMath()
# create pipeline: use terrain dataset. Just for kicks we'll treat the elevations
......
......@@ -7,7 +7,7 @@ VTK_DATA_ROOT = vtkGetDataRoot()
# Interpolate onto a volume
# Parameters for debugging
NPts = 100000
NPts = 20000
math = vtk.vtkMath()
math.RandomSeed(31415)
......@@ -111,6 +111,7 @@ ren0.SetViewport(0,0,.5,1)
ren1 = vtk.vtkRenderer()
ren1.SetViewport(0.5,0,1,1)
renWin = vtk.vtkRenderWindow()
renWin.SetMultiSamples(0)
renWin.AddRenderer(ren0)
renWin.AddRenderer(ren1)
iren = vtk.vtkRenderWindowInteractor()
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -924,6 +924,14 @@ void vtkMapper::MapScalarsToTexture(vtkAbstractArray* scalars, double alpha)
// In the future, we could extend vtkScalarsToColors.
vtkIdType numberOfColors = this->LookupTable->GetNumberOfAvailableColors();
numberOfColors += 2;
// number of available colors can return 2^24
// which is an absurd size for a tmap in this case. So we
// watch for cases like that and reduce it to a
// more reasonable size
if (numberOfColors > 65538) // 65536+2
{
numberOfColors = 8192;
}
double k = (range[1]-range[0]) / (numberOfColors-1-2);
vtkDoubleArray* tmp = vtkDoubleArray::New();
tmp->SetNumberOfTuples(numberOfColors*2);
......
......@@ -21,6 +21,7 @@
#include "vtkNew.h"
#include "vtkProperty.h"
#include "vtkPolyDataNormals.h"
#include "vtkTriangleMeshPointNormals.h"
#include "vtkRegressionTestImage.h"
#include "vtkTestUtilities.h"
......@@ -47,7 +48,7 @@ int TestUserShader(int argc, char *argv[])
reader->SetFileName(fileName);
reader->Update();
vtkNew<vtkPolyDataNormals> norms;
vtkNew<vtkTriangleMeshPointNormals> norms;
norms->SetInputConnection(reader->GetOutputPort());
norms->Update();
......
......@@ -19,7 +19,6 @@
#include "vtkNew.h"
#include "vtkOpenGLPolyDataMapper.h"
#include "vtkPLYReader.h"
#include "vtkPolyDataNormals.h"
#include "vtkProperty.h"
#include "vtkRegressionTestImage.h"
#include "vtkRenderWindow.h"
......@@ -28,6 +27,7 @@
#include "vtkShaderProgram.h"
#include "vtkTestUtilities.h"
#include "vtkTimerLog.h"
#include "vtkTriangleMeshPointNormals.h"
#define VTK_CREATE(type, name) \
......@@ -105,7 +105,7 @@ int TestUserShader2(int argc, char *argv[])
reader->SetFileName(fileName);
reader->Update();
vtkNew<vtkPolyDataNormals> norms;
vtkNew<vtkTriangleMeshPointNormals> norms;
norms->SetInputConnection(reader->GetOutputPort());
norms->Update();
......
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