summaryrefslogtreecommitdiff
path: root/src/cython/include/Persistence_landscape_interface.h
blob: e18a678e45d57547db1b2920a4b4dfdf3bcb9efd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
/*    This file is part of the Gudhi Library. The Gudhi library
 *    (Geometric Understanding in Higher Dimensions) is a generic C++
 *    library for computational topology.
 *
 *    Author(s):       Pawel Dlotko
 *
 *    Copyright (C) 2017  Swansea University
 *
 *    This program is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    This program is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

#ifndef PERSISTENCE_LANDSCAPE_INTERFACE_H_
#define PERSISTENCE_LANDSCAPE_INTERFACE_H_

#include <gudhi/Persistence_landscape.h>

namespace Gudhi {
namespace Persistence_representations {


class Persistence_landscape_interface : public Persistence_landscape 
{
 public:
  Persistence_landscape_interface():Persistence_landscape(){}

  Persistence_landscape_interface(const std::vector<std::pair<double, double> >& p, size_t number_of_levels = std::numeric_limits<size_t>::max() ):Persistence_landscape(p,number_of_levels){}

  Persistence_landscape_interface(const char* filename, size_t dimension = std::numeric_limits<unsigned>::max() , size_t number_of_levels = std::numeric_limits<size_t>::max() ):Persistence_landscape(filename,dimension,number_of_levels){}  
  
  Persistence_landscape_interface* copy() 
  {
	Persistence_landscape_interface* copy = new Persistence_landscape_interface(*this);		
	return copy;
  }
  
  Persistence_landscape_interface* new_abs_interface()
  {
	   return (Persistence_landscape_interface*)this->new_abs();
  }
  
  void new_compute_average(const std::vector<Persistence_landscape_interface*>& to_average) 
  {
	  std::vector<Persistence_landscape*> to_average_new;
	  to_average_new.reserve( to_average.size() );
	  for ( size_t i = 0 ; i != to_average.size() ; ++i )
	  {
		  to_average_new.push_back( (Persistence_landscape*)to_average[i] );
	  }
	  this->compute_average(to_average_new);
  }

/*
  void load_landscape_from_file_interface(const char* filename)
  {
	  this->load_landscape_from_file(filename);
  }


  void print_to_file_interface(const char* filename) const
  {
	  this->print_to_file(filename);
  }


  double compute_integral_of_landscape_interface() const
  {
	  return this->compute_integral_of_landscape();
  }


  double compute_integral_of_a_level_of_a_landscape_interface(size_t level) const
  {
	  return this->compute_integral_of_a_level_of_a_landscape(level);
  }


  double compute_integral_of_landscape_interface(double p) const
  {
	  return this->compute_integral_of_landscape(p);
  }


  double compute_value_at_a_given_point_interface(unsigned level, double x) const
  {
	  return this->compute_value_at_a_given_point(level,x);
  }


  double compute_maximum_interface() const
  {
	  return this->compute_maximum();
  }
  
  
  double compute_minimum_interface() const 
  {
	  return this->compute_minimum();
  }
  
  
  
  double compute_norm_of_landscape_interface(double i) 
  {
	  return this->compute_norm_of_landscape(i);
  }
  
  
  Persistence_landscape abs_interface()
  {
	  return this->abs();
  }

  size_t size_interface() const
  {
	  return this->size();
  }

  double find_max_interface(unsigned lambda) const
  {
	  return this->find_max();
  }

  friend double compute_inner_product_interface(const Persistence_landscape& l1, const Persistence_landscape& l2)
  {
	  return this->compute_inner_product(l1,l2);
  }

  double project_to_R_interface(int number_of_function) const 
  {
	  return this->project_to_R(number_of_function); 
  }
  
  
  size_t number_of_projections_to_R_interface() const 
  {
	  return this->number_of_projections_to_R();
  }
  
  
  std::vector<double> vectorize_interface(int number_of_function) const 
  {
	  return this->vectorize( number_of_function );
  }
  
  
  size_t number_of_vectorize_function_interface() const 
  {
	  return this->number_of_vectorize_function();
  }
  
  
  void compute_average_interface(const std::vector<Persistence_landscape*>& to_average) 
  {
	  return this->compute_average(to_average);
  }
  
  
  double distance_interface(const Persistence_landscape& second, double power = 1) 
  {
	  return this->distance( second, power );
  }
 
 
  double compute_scalar_product_interface(const Persistence_landscape& second) const 
  {
	  return this->compute_scalar_product( second );
  }


  std::pair<double, double> get_y_range_interface(size_t level = 0) const 
  {
	  return this->get_y_range( level );
  }
  */
};

}  // namespace Persistence_representations
}  // namespace Gudhi

#endif  // PERSISTENCE_LANDSCAPE_INTERFACE_H_