source: trunk/Clp/src/MyMessageHandler.hpp @ 2385

Last change on this file since 2385 was 2385, checked in by unxusr, 4 months ago

formatting

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 2.1 KB
Line 
1/* $Id: MyMessageHandler.hpp 2385 2019-01-06 19:43:06Z unxusr $ */
2// Copyright (C) 2003, International Business Machines
3// Corporation and others.  All Rights Reserved.
4// This code is licensed under the terms of the Eclipse Public License (EPL).
5
6#ifndef MyMessageHandler_H
7#define MyMessageHandler_H
8
9#include <deque>
10
11#include "CoinPragma.hpp"
12#include <stdio.h>
13#include "CoinMessageHandler.hpp"
14
15/** This just adds a model to CoinMessage and a void pointer so
16    user can trap messages and do useful stuff.
17    This is used in Clp/Test/unitTest.cpp
18
19    The file pointer is just there as an example of user stuff.
20    In practice you might have
21
22*/
23class ClpSimplex;
24
25typedef std::vector< double > StdVectorDouble;
26
27class MyMessageHandler : public CoinMessageHandler {
28
29public:
30  /**@name Overrides */
31  //@{
32  virtual int print();
33  //@}
34  /**@name set and get */
35  //@{
36  /// Model
37  const ClpSimplex *model() const;
38  void setModel(ClpSimplex *model);
39  /// Get queue of feasible extreme points
40  const std::deque< StdVectorDouble > &getFeasibleExtremePoints() const;
41  /// Empty queue of feasible extreme points
42  void clearFeasibleExtremePoints();
43  //@}
44
45  /**@name Constructors, destructor */
46  //@{
47  /** Default constructor. */
48  MyMessageHandler();
49  /// Constructor with pointer to model
50  MyMessageHandler(ClpSimplex *model,
51    FILE *userPointer = NULL);
52  /** Destructor */
53  virtual ~MyMessageHandler();
54  //@}
55
56  /**@name Copy method */
57  //@{
58  /** The copy constructor. */
59  MyMessageHandler(const MyMessageHandler &);
60  /** The copy constructor from an CoinSimplexMessageHandler. */
61  MyMessageHandler(const CoinMessageHandler &);
62
63  MyMessageHandler &operator=(const MyMessageHandler &);
64  /// Clone
65  virtual CoinMessageHandler *clone() const;
66  //@}
67
68protected:
69  /**@name Data members
70        The data members are protected to allow access for derived classes. */
71  //@{
72  /// Pointer back to model
73  ClpSimplex *model_;
74  /// Saved extreme points
75  std::deque< StdVectorDouble > feasibleExtremePoints_;
76  /// Iteration number so won't do same one twice
77  int iterationNumber_;
78  //@}
79};
80
81#endif
82
83/* vi: softtabstop=2 shiftwidth=2 expandtab tabstop=2
84*/
Note: See TracBrowser for help on using the repository browser.