Lines Matching refs:bins
20 PetscReal *bins; member
58 PetscErrorCode PetscDrawHGCreate(PetscDraw draw, int bins, PetscDrawHG *hist) in PetscDrawHGCreate() argument
64 PetscValidLogicalCollectiveInt(draw, bins, 2); in PetscDrawHGCreate()
77 h->numBins = bins; in PetscDrawHGCreate()
78 h->maxBins = bins; in PetscDrawHGCreate()
79 PetscCall(PetscMalloc1(h->maxBins, &h->bins)); in PetscDrawHGCreate()
103 PetscErrorCode PetscDrawHGSetNumberBins(PetscDrawHG hist, int bins) in PetscDrawHGSetNumberBins() argument
107 PetscValidLogicalCollectiveInt(hist, bins, 2); in PetscDrawHGSetNumberBins()
109 if (hist->maxBins < bins) { in PetscDrawHGSetNumberBins()
110 PetscCall(PetscFree(hist->bins)); in PetscDrawHGSetNumberBins()
111 PetscCall(PetscMalloc1(bins, &hist->bins)); in PetscDrawHGSetNumberBins()
112 hist->maxBins = bins; in PetscDrawHGSetNumberBins()
114 hist->numBins = bins; in PetscDrawHGSetNumberBins()
165 PetscCall(PetscFree((*hist)->bins)); in PetscDrawHGDestroy()
308 …PetscReal xmin, xmax, ymin, ymax, *bins, *values, *weights, binSize, binLeft, binRight, maxHeigh… in PetscDrawHGDraw() local
344 bins = hist->bins; in PetscDrawHGDraw()
345 bins[0] = 0.; in PetscDrawHGDraw()
347 if (values[p] == xmin) bins[0] += weights[0]; in PetscDrawHGDraw()
353 maxHeight = bins[0]; in PetscDrawHGDraw()
378 …PetscCall(PetscDrawRectangle(draw, binLeft, ymin, binRight, bins[0], bcolor, bcolor, bcolor, bcolo… in PetscDrawHGDraw()
379 PetscCall(PetscDrawLine(draw, binLeft, ymin, binLeft, bins[0], PETSC_DRAW_BLACK)); in PetscDrawHGDraw()
380 PetscCall(PetscDrawLine(draw, binRight, ymin, binRight, bins[0], PETSC_DRAW_BLACK)); in PetscDrawHGDraw()
381 PetscCall(PetscDrawLine(draw, binLeft, bins[0], binRight, bins[0], PETSC_DRAW_BLACK)); in PetscDrawHGDraw()
396 bins = hist->bins; in PetscDrawHGDraw()
398 PetscCall(PetscArrayzero(bins, numBins)); in PetscDrawHGDraw()
405 if ((values[p] >= binLeft) && (values[p] < binRight)) bins[i] += weights[p]; in PetscDrawHGDraw()
407 if ((i == numBins - 1) && (values[p] == binRight)) bins[i] += weights[p]; in PetscDrawHGDraw()
415 maxHeight = PetscMax(maxHeight, bins[i]); in PetscDrawHGDraw()
442 …PetscCall(PetscDrawRectangle(draw, binLeft, ymin, binRight, bins[i], bcolor, bcolor, bcolor, bcolo… in PetscDrawHGDraw()
443 PetscCall(PetscDrawLine(draw, binLeft, ymin, binLeft, bins[i], PETSC_DRAW_BLACK)); in PetscDrawHGDraw()
444 PetscCall(PetscDrawLine(draw, binRight, ymin, binRight, bins[i], PETSC_DRAW_BLACK)); in PetscDrawHGDraw()
445 PetscCall(PetscDrawLine(draw, binLeft, bins[i], binRight, bins[i], PETSC_DRAW_BLACK)); in PetscDrawHGDraw()
446 if (color == PETSC_DRAW_ROTATE && bins[i]) bcolor++; in PetscDrawHGDraw()
494 PetscReal xmax, xmin, *bins, *values, *weights, binSize, binLeft, binRight, mean, var, totwt = 0.; in PetscDrawHGView() local
516 bins = hist->bins; in PetscDrawHGView()
517 bins[0] = 0.; in PetscDrawHGView()
519 if (values[p] == xmin) bins[0] += weights[0]; in PetscDrawHGView()
526 …Printf(viewer, "Bin %2d (%6.2g - %6.2g): %.0g\n", 0, (double)xmin, (double)xmax, (double)bins[0])); in PetscDrawHGView()
540 bins = hist->bins; in PetscDrawHGView()
543 PetscCall(PetscArrayzero(bins, numBins)); in PetscDrawHGView()
548 if ((values[p] >= binLeft) && (values[p] < binRight)) bins[i] += weights[p]; in PetscDrawHGView()
550 if ((i == numBins - 1) && (values[p] == binRight)) bins[i] += weights[p]; in PetscDrawHGView()
563 …" PetscInt_FMT " (%6.2g - %6.2g): %.0g\n", i, (double)binLeft, (double)binRight, (double)bins[i])); in PetscDrawHGView()