The SDL Component Suite is an industry leading collection of components supporting scientific and engineering computing. Please visit the SDL Web site for more information....



Save


Unit: SDL_dstruct
Class: TFeatureMatrix
Declaration: procedure Save (FName: string);

The method Save stores the contents of the feature matrix in the structured text file named FName.

Format of the data file: the data values of the feature matrix are stored using keywords starting with a '#' character and followed by zero to two parameters. Each data value, each defintion and each keyword have to be stored in separate lines, the keywords have to start at position 1 of the line:

Keyword Explanation
#featdef NFEAT VERS Definition of the features; NFEAT specifies the number of features, VERS the version number of the format. The keyword is followed by 6*NFEAT lines specifying the fields of the feature properties. Each field is defined by its feature index, the field identifier and the associated value (stored as a string). The field GUIElem is not stored at all.
#featvals NFEAT NOBJ The list of the matrix values; NFEAT specifies the number of features, NOBJ the number of objects. All data cells which are not empty (undefined) are stored in the following lines until the '#featend' keyword is encountered. Each cell value is stored as a string preceded by the feature and the object index (separated by blanks)
#featend Indicates the end of the matrix values.

Example: The text file below defines a feature matrix with four features and 10 objects. Most of the cells are empty or undefined. Reading the text file creates a feature matrix displayed at the right:
#featdef 4 1
1 fplFeatNum 1
1 fplFeatName Name
1 fplFeatKind fkString
1 fplComment
1 fplPresets Smith; Unknown;
1 fplSorted TRUE
2 fplFeatNum 2
2 fplFeatName ID-No.
2 fplFeatKind fkInteger
2 fplComment
2 fplPresets
2 fplSorted FALSE
3 fplFeatNum 44
3 fplFeatName Membership
3 fplFeatKind fkTriState
3 fplComment
3 fplPresets
3 fplSorted FALSE
4 fplFeatNum 55
4 fplFeatName Score
4 fplFeatKind fkDouble
4 fplComment The scores are incomplete
4 fplPresets
4 fplSorted TRUE
#featvals 4 10
1 1 Miller
2 1 1032
3 1 false
1 2 Smith
2 2 231887118222799
3 2 false
1 3 Tolston
2 3 32
4 3 0.458571428571429
1 4 Vanadin
2 4 5512383626717828
3 3 true
4 4 -0.0008344
1 5 Winder
2 5 68123131311114
1 6 Witte
2 6 114
3 6 false
1 7 Woolfe
2 7 818491
1 8 Wunster
2 8 318
3 8 false
1 9 Zika
2 9 8127
4 9 -1.12519
1 10 Zodiak
2 10 9000009
#featend



Last Update: 2017-Apr-18