/*
 * Copyright (c) 1999 Johnny C. Lam.
 * All rights reserved.
 *
 * Permission to use, copy, modify, distribute and sell this software
 * and its documentation for any purpose is hereby granted without fee,
 * provided that the above copyright notice appear in all copies and
 * that both that copyright notice and this permission notice appear
 * in supporting documentation.  The author makes no representations
 * about the suitability of this software for any purpose.  It is
 * provided "as is" without express or implied warranty.
 */

// -*- C++ -*-

#ifndef INDEPENDENT_SEGMENT_H_INCLUDED
#define INDEPENDENT_SEGMENT_H_INCLUDED

#ifndef STL_MAP_INCLUDED
#include <map>
#define STL_MAP_INCLUDED
#endif

#ifndef STL_UTILITY_INCLUDED
#include <utility>
#define STL_UTILITY_INCLUDED
#endif

#ifndef HAPLOTYPE_H_INCLUDED
#include "haplotype.h"
#endif

#ifndef SEGMENT_H_INCLUDED
#include "segment.h"
#endif

class HDictionary;

///////////////////////////////////////////////////////////////////////////
//
// IndependentProbability
//
// Concrete class derived from SegmentProbability.  The probability of a
// haplotype segment is calculated by assuming independence of the markers.
//
///////////////////////////////////////////////////////////////////////////

class IndependentProbability : public SegmentProbability {
public:
    IndependentProbability(bool = false);

    probability	Probability(HDictionary*, const Haplotype&, size_type) const;

private:
    typedef std::map<std::pair<size_type, Haplotype>, probability> FragmentMap;
    mutable FragmentMap prob_cache;
};

#include "independent_segment_inline.h"

#endif // INDEPENDENT_SEGMENT_H_INCLUDED
