comp.lang.ada
 help / color / mirror / Atom feed
From: Jeffrey Carter <spam@spam.com>
Subject: Re: How to model unknown values in a vector?
Date: Sun, 01 Jun 2003 03:17:35 GMT
Date: 2003-06-01T03:17:35+00:00	[thread overview]
Message-ID: <3ED970CF.3080008@spam.com> (raw)
In-Reply-To: BAFE7E15.3898%harald.schmidt@anobject.net

Harald Schmidt wrote:
 >
 > Does anyone know how to model values in a vector, which are unknown.
 > I can't use the zero value because this is a valid value. Minus
 > infinity could be an option, but I am searching for a better method
 > to handle unknown values.

Use this type for the vector elements:

type Vector_Element (Value_Known : Boolean := False) is record
    case Value_Known is
    when False =>
       null;
    when True =>
       Value : Real_Vector_Element_Type [:= Some_Useful_Default_Value];
    end case;
end record;

-- 
Jeff Carter
"When Roman engineers built a bridge, they had to stand under it
while the first legion marched across. If programmers today
worked under similar ground rules, they might well find
themselves getting much more interested in Ada!"
Robert Dewar




  parent reply	other threads:[~2003-06-01  3:17 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-05-31 13:43 How to model unknown values in a vector? Harald Schmidt
2003-05-31 22:47 ` FranciKait
2003-06-01  3:17 ` Jeffrey Carter [this message]
2003-06-04  1:04 ` Nick Roberts
2003-06-04 15:56   ` Mário Amado Alves
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox