Lines Matching refs:weights
24 PetscReal *weights; member
84 PetscCall(PetscMalloc2(h->maxValues, &h->values, h->maxValues, &h->weights)); in PetscDrawHGCreate()
166 PetscCall(PetscFree2((*hist)->values, (*hist)->weights)); in PetscDrawHGDestroy()
200 PetscCall(PetscArraycpy(tmpw, hist->weights, hist->maxValues)); in PetscDrawHGAddValue()
201 PetscCall(PetscFree2(hist->values, hist->weights)); in PetscDrawHGAddValue()
204 hist->weights = tmpw; in PetscDrawHGAddValue()
233 hist->weights[hist->numValues] = 1.; in PetscDrawHGAddValue()
268 PetscCall(PetscArraycpy(tmpw, hist->weights, hist->maxValues)); in PetscDrawHGAddWeightedValue()
269 PetscCall(PetscFree2(hist->values, hist->weights)); in PetscDrawHGAddWeightedValue()
272 hist->weights = tmpw; in PetscDrawHGAddWeightedValue()
287 hist->weights[hist->numValues] = weight; in PetscDrawHGAddWeightedValue()
308 …PetscReal xmin, xmax, ymin, ymax, *bins, *values, *weights, binSize, binLeft, binRight, maxHeigh… in PetscDrawHGDraw() local
334 weights = hist->weights; in PetscDrawHGDraw()
347 if (values[p] == xmin) bins[0] += weights[0]; in PetscDrawHGDraw()
348 mean += values[p] * weights[p]; in PetscDrawHGDraw()
349 var += values[p] * values[p] * weights[p]; in PetscDrawHGDraw()
350 totwt += weights[p]; in PetscDrawHGDraw()
351 if (weights[p] != 1.) usewt = PETSC_TRUE; 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()
409 mean += values[p] * weights[p]; in PetscDrawHGDraw()
410 var += values[p] * values[p] * weights[p]; in PetscDrawHGDraw()
411 totwt += weights[p]; in PetscDrawHGDraw()
412 if (weights[p] != 1.) usewt = PETSC_TRUE; in PetscDrawHGDraw()
494 PetscReal xmax, xmin, *bins, *values, *weights, binSize, binLeft, binRight, mean, var, totwt = 0.; in PetscDrawHGView() local
511 weights = hist->weights; in PetscDrawHGView()
519 if (values[p] == xmin) bins[0] += weights[0]; in PetscDrawHGView()
520 mean += values[p] * weights[p]; in PetscDrawHGView()
521 var += values[p] * values[p] * weights[p]; in PetscDrawHGView()
522 totwt += weights[p]; in PetscDrawHGView()
523 if (weights[p] != 1.) usewt = PETSC_TRUE; 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()
552 mean += values[p] * weights[p]; in PetscDrawHGView()
553 var += values[p] * values[p] * weights[p]; in PetscDrawHGView()
554 totwt += weights[p]; in PetscDrawHGView()
555 if (weights[p] != 1.) usewt = PETSC_TRUE; in PetscDrawHGView()