is_scaletype

Returns if scaling type specified in scaletype is active.

unsigned char is_scaletype(lprec *lp, int scaletype);

Return Value

is_scaletype returns if scaling mode specified in scaletype is active.

Parameters

lp

Pointer to previously created lp model. See return value of make_lp, copy_lp, read_lp, read_LP, read_mps, read_freemps, read_MPS, read_freeMPS, read_XLI

scaletype

SCALE_EXTREME (1) Scale to convergence using largest absolute value
SCALE_RANGE (2) Scale based on the simple numerical range
SCALE_MEAN (3) Numerical range-based scaling
SCALE_GEOMETRIC (4) Geometric scaling
SCALE_CURTISREID (7) Curtis-reid scaling

Remarks

The is_scaletype function returns if scaling mode specified in scaletype. This can influence numerical stability considerably. It is advisable to always use some sort of scaling.
set_scaling must be called before solve is called.
SCALE_EXTREME, SCALE_RANGE, SCALE_MEAN, SCALE_GEOMETRIC, SCALE_CURTISREID are the possible scaling algorithms.

Example

#include <stdio.h>
#include <stdlib.h>
#include "lp_lib.h"

int main(void)
{
  lprec *lp;
  int scaletype;

  /* Create a new LP model */
  lp = make_lp(0, 0);
  if(lp == NULL) {
    fprintf(stderr, "Unable to create new LP model\n");
    return(1);
  }

  scaletype = is_scaletype(lp, SCALE_MEAN);

  delete_lp(lp);
  return(0);
}

lp_solve API reference

See Also make_lp, copy_lp, read_lp, read_LP, read_mps, read_freemps, read_MPS, read_freeMPS, read_XLI, set_scaling, get_scaling, set_scalelimit, get_scalelimit, is_integerscaling, is_scalemode