The outage for Sunday 24th November has been cancelled.
Bioplib
Protein Structure C Library
 All Data Structures Files Functions Variables Typedefs Macros Pages
Macros | Functions
fit.c File Reference

Perform least squares fitting of coordinate sets. More...

#include <math.h>
#include <stdio.h>
#include "MathType.h"
#include "fit.h"
#include "macros.h"

Go to the source code of this file.

Macros

#define SMALL   1.0e-20 /* Convergence cutoffs */
 
#define SMALSN   1.0e-10
 

Functions

BOOL blMatfit (COOR *x1, COOR *x2, REAL rm[3][3], int n, REAL *wt1, BOOL column)
 

Detailed Description

Perform least squares fitting of coordinate sets.

Version
V1.7
Date
17.07.14
Author
Dr. Andrew C. R. Martin
Institute of Structural & Molecular Biology, University College London, Gower Street, London. WC1E 6BT.
andre.nosp@m.w@bi.nosp@m.oinf..nosp@m.org..nosp@m.uk andre.nosp@m.w.ma.nosp@m.rtin@.nosp@m.ucl..nosp@m.ac.uk

This code is NOT IN THE PUBLIC DOMAIN, but it may be copied according to the conditions laid out in the accompanying file COPYING.DOC.

The code may be modified as required, but any modifications must be documented so that the person responsible can be identified.

The code may not be sold commercially or included as part of a commercial product except as described in the file COPYING.DOC.

Description:

This code performs least squares fitting of two coordinate set using the method of McLachlan as modified by Sutcliffe.

Usage:

Passed two coordinate arrays both centred around the origin and, optionally, an array of weights, returns a rotation matrix.

Revision History:

Definition in file fit.c.

Macro Definition Documentation

#define SMALL   1.0e-20 /* Convergence cutoffs */

Definition at line 86 of file fit.c.

#define SMALSN   1.0e-10

Definition at line 87 of file fit.c.

Function Documentation

BOOL blMatfit ( COOR x1,
COOR x2,
REAL  rm[3][3],
int  n,
REAL wt1,
BOOL  column 
)
Parameters
[in]*x1First (fixed) array of coordinates
[in]*x2Second (mobile) array of coordinates
[in]nNumber of coordinates
[in]*wt1Weight array or NULL
[in]columnTRUE: Output a column-wise matrix (as used by FRODO) FALSE: Output a standard row-wise matrix.
[out]rmReturned rotation matrix
Returns
TRUE: success FALSE: error

Fit coordinate array x2 to x1 both centred around the origin and of length n. Optionally weighted with the wt1 array if wt1 is not NULL. If column is set the matrix will be returned column-wise rather than row-wise.

  • 04.02.91 Original based on code by Mike Sutcliffe
  • 01.06.92 ANSIed & doc'd
  • 17.06.93 various changes for release (including parameters)
  • 11.03.94 column changed to BOOL
  • 25.11.02 Corrected header!
  • 07.07.14 Use bl prefix for functions By: CTP

Definition at line 128 of file fit.c.