Skip to content
This repository has been archived by the owner on Nov 19, 2020. It is now read-only.

Commit

Permalink
Marking several classes as Serializable.
Browse files Browse the repository at this point in the history
 - Updates GH-913: KNearestNeighbors can not be serialized
  • Loading branch information
cesarsouza committed Sep 28, 2017
1 parent 9e37b2c commit 48c223a
Show file tree
Hide file tree
Showing 12 changed files with 12 additions and 3 deletions.
1 change: 1 addition & 0 deletions Sources/Accord.Core/Collections/BinaryNode.cs
Expand Up @@ -31,6 +31,7 @@ namespace Accord.Collections
///
/// <typeparam name="TNode">The class type for the nodes of the tree.</typeparam>
///
[Serializable]
public class BinaryNode<TNode> : IEquatable<TNode> // TODO: Try to remove IEquatable
where TNode : BinaryNode<TNode>
{
Expand Down
2 changes: 1 addition & 1 deletion Sources/Accord.Core/Collections/PriorityQueue.cs
Expand Up @@ -58,7 +58,7 @@ namespace Accord.Collections
using System.Diagnostics;
using System.Runtime.CompilerServices;
using System.Text;
using Accord.Compat;
using Accord.Compat;

/// <summary>
/// Priority order for <see cref="PriorityQueue{T}"/>.
Expand Down
2 changes: 1 addition & 1 deletion Sources/Accord.Core/Collections/PriorityQueueNode.cs
Expand Up @@ -53,7 +53,7 @@
namespace Accord.Collections
{
using System;
using Accord.Compat;
using Accord.Compat;

/// <summary>
/// Represents the node of a priority queue.
Expand Down
2 changes: 1 addition & 1 deletion Sources/Accord.Core/Collections/RedBlackTreeNode.cs
Expand Up @@ -24,7 +24,7 @@ namespace Accord.Collections
{
using System;
using System.Collections.Generic;
using Accord.Compat;
using Accord.Compat;

/// <summary>
/// Possible node colors for <see cref="RedBlackTree{T}"/>s.
Expand Down
1 change: 1 addition & 0 deletions Sources/Accord.Core/Collections/TreeNode.cs
Expand Up @@ -31,6 +31,7 @@ namespace Accord.Collections
///
/// <typeparam name="TNode">The class type for the nodes of the tree.</typeparam>
///
[Serializable]
public class TreeNode<TNode>
where TNode : TreeNode<TNode>
{
Expand Down
1 change: 1 addition & 0 deletions Sources/Accord.Genetic/Chromosomes/GP/GPTreeNode.cs
Expand Up @@ -26,6 +26,7 @@ namespace Accord.Genetic
/// programming tree may represent its sub tree or even entire tree.</para>
/// </remarks>
///
[Serializable]
public class GPTreeNode : ICloneable
{
/// <summary>
Expand Down
Expand Up @@ -36,6 +36,7 @@ namespace Accord.Collections
/// <typeparam name="TPoint">The type for the position vector (e.g. double[]).</typeparam>
/// <typeparam name="TNode">The class type for the nodes of the tree.</typeparam>
///
[Serializable]
public class VPTreeNodeBase<TPoint, TNode> : BinaryNode<TNode>, IEquatable<TNode> // TODO: Try to remove IEquatable
where TNode : VPTreeNodeBase<TPoint, TNode>
{
Expand Down
1 change: 1 addition & 0 deletions Sources/Accord.MachineLearning/Collections/SPTreeNode.cs
Expand Up @@ -64,6 +64,7 @@ namespace Accord.Collections
/// Node for a Space-Partitioning Tree.
/// </summary>
///
[Serializable]
public class SPTreeNode : TreeNode<SPTreeNode>
{
SPTree owner;
Expand Down
1 change: 1 addition & 0 deletions Sources/Accord.MachineLearning/Collections/VPTreeNode`1.cs
Expand Up @@ -32,6 +32,7 @@ namespace Accord.Collections
///
/// <typeparam name="TPoint">The type for the position vector (e.g. double[]).</typeparam>
///
[Serializable]
public class VPTreeNode<TPoint> : VPTreeNodeBase<TPoint, VPTreeNode<TPoint>>
{

Expand Down
1 change: 1 addition & 0 deletions Sources/Accord.MachineLearning/Collections/VPTreeNode`2.cs
Expand Up @@ -33,6 +33,7 @@ namespace Accord.Collections
/// <typeparam name="TPoint">The type for the position vector (e.g. double[]).</typeparam>
/// <typeparam name="TData">The type for the value stored at the node.</typeparam>
///
[Serializable]
public class VPTreeNode<TPoint, TData> : VPTreeNodeBase<TPoint, VPTreeNode<TPoint, TData>>
{
/// <summary>
Expand Down
Expand Up @@ -29,6 +29,7 @@ namespace Accord.MachineLearning.DecisionTrees.Rules
/// Antecedent expression for <see cref="DecisionRule"/>s.
/// </summary>
///
[Serializable]
public struct Antecedent : IEquatable<Antecedent>
{
private int index;
Expand Down
Expand Up @@ -48,6 +48,7 @@ namespace Accord.MachineLearning.DecisionTrees.Rules
/// <seealso cref="C45Learning"/>
/// <seealso cref="ID3Learning"/>
///
[Serializable]
public class DecisionRule : ICloneable, IEnumerable<Antecedent>,
IEquatable<DecisionRule>, IComparable<DecisionRule>
{
Expand Down

0 comments on commit 48c223a

Please sign in to comment.